Skip to content

Commit bbdb98f

Browse files
authored
address acceptance comments (#328)
1 parent f579141 commit bbdb98f

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

internal/cmd/config/profile/set/set.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,16 @@ func NewCmd(p *print.Printer) *cobra.Command {
5050
return fmt.Errorf("set profile: %w", err)
5151
}
5252

53+
p.Info("Successfully set active profile to %q\n", model.Profile)
54+
5355
flow, err := auth.GetAuthFlow()
5456
if err != nil {
5557
p.Debug(print.WarningLevel, "both keyring and text file storage failed to find a valid authentication flow for the active profile")
5658
p.Warn("The active profile %q is not authenticated, please login using the 'stackit auth login' command.\n", model.Profile)
57-
} else {
58-
p.Debug(print.DebugLevel, "found valid authentication flow for active profile: %s", flow)
59+
return nil
5960
}
61+
p.Debug(print.DebugLevel, "found valid authentication flow for active profile: %s", flow)
6062

61-
p.Info("Successfully set active profile to %q\n", model.Profile)
6263
return nil
6364
},
6465
}

internal/cmd/config/profile/unset/unset.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,16 @@ func NewCmd(p *print.Printer) *cobra.Command {
3232
return fmt.Errorf("unset profile: %w", err)
3333
}
3434

35+
p.Info("Profile unset successfully. The default profile will be used.\n")
36+
3537
flow, err := auth.GetAuthFlow()
3638
if err != nil {
3739
p.Debug(print.WarningLevel, "both keyring and text file storage failed to find a valid authentication flow for the active profile")
3840
p.Warn("The default profile is not authenticated, please login using the 'stackit auth login' command.\n")
39-
} else {
40-
p.Debug(print.DebugLevel, "found valid authentication flow for active profile: %s", flow)
41+
return nil
4142
}
43+
p.Debug(print.DebugLevel, "found valid authentication flow for active profile: %s", flow)
4244

43-
p.Info("Profile unset successfully. The default profile will be used.\n")
4445
return nil
4546
},
4647
}

0 commit comments

Comments
 (0)