Skip to content

Commit

Permalink
Changed .Run(...) to .RunE(...); Fixes #289
Browse files Browse the repository at this point in the history
  • Loading branch information
Xemdo committed Nov 28, 2023
1 parent fe21ba4 commit d783250
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func configureCmdRun(cmd *cobra.Command, args []string) error {
}

if err := viper.WriteConfigAs(configPath); err != nil {
fmt.Errorf("Failed to write configuration: %v", err.Error())
return fmt.Errorf("Failed to write configuration: %v", err.Error())
}

fmt.Println("Updated configuration.")
Expand Down
6 changes: 5 additions & 1 deletion cmd/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ func loginCmdRun(cmd *cobra.Command, args []string) error {

if clientID == "" || clientSecret == "" {
println("No Client ID or Secret found in configuration. Triggering configuration now.")
configureCmd.Run(cmd, args)
err := configureCmd.RunE(cmd, args)
if err != nil {
return err
}

clientID = viper.GetString("clientId")
clientSecret = viper.GetString("clientSecret")
}
Expand Down

0 comments on commit d783250

Please sign in to comment.