File tree 4 files changed +8
-13
lines changed
4 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,6 @@ var rootCmd = &cobra.Command{
16
16
Use : "aws-cli-manager" ,
17
17
Short : "AWS CLI Manager is a tool to manage AWS CLI profiles" ,
18
18
Run : func (cmd * cobra.Command , args []string ) {
19
- // SelectProfile now returns a boolean indicating whether a profile was selected
20
- // We don't need to do anything with the return value here
21
19
profile .SelectProfile ()
22
20
},
23
21
}
Original file line number Diff line number Diff line change @@ -13,12 +13,8 @@ var selectCmd = &cobra.Command{
13
13
Run : func (cmd * cobra.Command , args []string ) {
14
14
if len (args ) == 0 {
15
15
// If no profile is specified, show the selection menu
16
- // SelectProfile now returns a boolean indicating whether a profile was selected
17
- selected := profile .SelectProfile ()
18
- if ! selected {
19
- // User cancelled the selection with Ctrl+C
20
- return
21
- }
16
+ // SelectProfile returns false if user cancels with Ctrl+C
17
+ profile .SelectProfile ()
22
18
} else {
23
19
// If a profile is specified, select it directly
24
20
profileName := args [0 ]
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ func ListProfiles() {
21
21
22
22
// Fill the table with the profiles
23
23
for awsProfile , details := range awsProfiles .Profiles {
24
- ssoStatus := "No"
24
+ var ssoStatus string
25
25
if details .SSOEnabled {
26
26
ssoStatus = color .GreenString ("Yes" )
27
27
} else {
Original file line number Diff line number Diff line change @@ -227,13 +227,14 @@ func installAWSCLI() {
227
227
228
228
osSystem := detectOS ()
229
229
230
- if osSystem == "darwin" {
230
+ switch osSystem {
231
+ case "darwin" :
231
232
installAWSCLIMac ()
232
- } else if osSystem == "linux" {
233
+ case "linux" :
233
234
installAWSCLILinux ()
234
- } else if osSystem == "windows" {
235
+ case "windows" :
235
236
installAWSCLIWindows ()
236
- } else {
237
+ default :
237
238
message := fmt .Errorf ("unsupported OS detected, please use MacOS, Linux or Windows" )
238
239
log .Fatalf ("%v" , message )
239
240
}
You can’t perform that action at this time.
0 commit comments