Skip to content

Commit

Permalink
config: add missing error check (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
craftamap committed Sep 8, 2021
1 parent 4552740 commit b038254
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmd/commands/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,14 @@ func Add(rootCmd *cobra.Command, _ *options.GlobalOptions) {
logging.Note(fmt.Sprintf("Setting \"%s\" to \"%s\" in %s", key, newValue, path))
logging.Debugf("%+v", tmpVp.AllSettings())

// This will most likely save everything as a string
// TODO: find this out and find a way to save bools and numbers
tmpVp.Set(key, newValue)
logging.Debugf("%+v", tmpVp.AllSettings())

config.WriteViper(tmpVp, path)
err = config.WriteViper(tmpVp, path)
if err != nil {
logging.Error(err)
return
}

logging.SuccessExclamation(fmt.Sprintf("Successfully updated configuration %s", path))
}
Expand Down

0 comments on commit b038254

Please sign in to comment.