Commit 2572ee11 authored by Simon Schürg's avatar Simon Schürg 🚀
Browse files

fix(login-profile): Handle invalid the case if a invalid profile is given

parent 8f837d41
......@@ -65,6 +65,11 @@ var loginCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
if profile != "" {
loginProfile := GetProfile(profile)
if loginProfile == nil {
fmt.Printf("Login profile %s not found.\n", profile)
fmt.Println("Check your config at " + viper.ConfigFileUsed())
os.Exit(1)
}
tokenSet := loginProfile.Login()
internal.PrintTokenSet(tokenSet)
if toClipboard {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment