This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(GH-15) Add
utils.WriteConfig
method
This commit adds the `utils.WriteConfig` method, which is called after each `prm set <PARAM>` command is run. This calls `viper.WriteConfig` to persist the config on disk. Also some minor refactoring of `cmd/set`
- Loading branch information
sanfrancrisko
committed
Nov 30, 2021
1 parent
b63290b
commit fbd6520
Showing
4 changed files
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package utils | ||
|
||
import ( | ||
"github.com/rs/zerolog/log" | ||
"github.com/spf13/viper" | ||
) | ||
|
||
func WriteConfig() { | ||
if err := viper.WriteConfig(); err != nil { | ||
log.Error().Msgf("could not write config to %s: %s", viper.ConfigFileUsed(), err) | ||
} | ||
} |