Skip to content

Commit

Permalink
fix: change order of mender-clirc discovery
Browse files Browse the repository at this point in the history
When using the .mender-clirc files the order in which those files are looked after should be in reverse. They should be discovered from local to global.

This commit changes the order from lokal folder first, home directory second and after that the global in etc.

Changelog: Title
Ticket: None

Signed-off-by: Jan Schmidle <[email protected]>
  • Loading branch information
bitcloud committed Mar 26, 2024
1 parent 384a79d commit 93bdb1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ const (
func init() {
viper.SetConfigName(".mender-clirc")
viper.SetConfigType("json")
viper.AddConfigPath("/etc/mender-cli/")
viper.AddConfigPath("$HOME/")
viper.AddConfigPath(".")
viper.AddConfigPath("$HOME/")
viper.AddConfigPath("/etc/mender-cli/")
if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
log.Info(fmt.Sprintf("Failed to read config: %s", err))
Expand Down

0 comments on commit 93bdb1e

Please sign in to comment.