Skip to content

Commit

Permalink
minor changes for getting correct profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaysomani07 committed Mar 23, 2023
1 parent 1a8058e commit 73d16a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/aws/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 73d16a6

Please sign in to comment.