Skip to content

Commit

Permalink
move print viper config to after cli setup
Browse files Browse the repository at this point in the history
  • Loading branch information
caesarshift committed Jul 10, 2023
1 parent 74153a7 commit 0d4cc29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ func cliSetup() {
message.DisableColor()
}

printViperConfigUsed()

// No log level set, so use the default
if logLevel != "" {
if lvl, ok := match[logLevel]; ok {
Expand Down
5 changes: 5 additions & 0 deletions src/cmd/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ func initViper() {
v.SetEnvPrefix("zarf")
v.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
v.AutomaticEnv()
}

func printViperConfigUsed() {
// Confirm initialization
initViper()

// Optional, so ignore errors
err := v.ReadInConfig()
Expand Down

0 comments on commit 0d4cc29

Please sign in to comment.