Skip to content

Commit

Permalink
fix: don't read config for man/completion commands
Browse files Browse the repository at this point in the history
Fixes nikaro#12
  • Loading branch information
nikaro committed Aug 8, 2022
1 parent eb3728c commit 1f2621f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wirelogd.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ func initConfig() {
}

// read config
if err := viper.ReadInConfig(); err != nil {
log.Warn().Err(err).Send()
if !lo.Contains([]string{"man", "completion"}, os.Args[1]) {
if err := viper.ReadInConfig(); err != nil {
log.Warn().Err(err).Send()
}
}

// set global config
Expand Down

0 comments on commit 1f2621f

Please sign in to comment.