From 73d16a6e90baa9066bc122c5f3a8553aae0938b5 Mon Sep 17 00:00:00 2001 From: chinmaysomani Date: Thu, 23 Mar 2023 11:18:34 +0530 Subject: [PATCH] minor changes for getting correct profiles --- internal/aws/config.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/aws/config.go b/internal/aws/config.go index 9510dac..386d3bd 100644 --- a/internal/aws/config.go +++ b/internal/aws/config.go @@ -115,7 +115,11 @@ func GetProfiles() (profiles []string, err error) { } for i := 0; i < len(defaultReturn.Data); i++ { spltiArr := strings.Split(defaultReturn.Data[i], " ") - ret = append(ret, spltiArr[len(spltiArr)-1]) + if len(spltiArr) == 1 { + ret = append(ret, spltiArr[len(spltiArr)-1]) + } else if len(spltiArr) > 1 && spltiArr[0] == "profile" { + ret = append(ret, spltiArr[len(spltiArr)-1]) + } } return ret, nil }