Skip to content

Commit

Permalink
fix: ignore config file not found errors (#2838)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <[email protected]>
  • Loading branch information
AustinAbro321 authored Aug 5, 2024
1 parent 594a283 commit ee60eb8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cmd/common/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,11 @@ func printViperConfigUsed() {
if !vInitialized {
return
}
// Optional, so ignore file not found errors
var notFoundErr *viper.ConfigFileNotFoundError
if vConfigError != nil && !errors.As(vConfigError, &notFoundErr) {
var notFoundErr viper.ConfigFileNotFoundError
if errors.As(vConfigError, &notFoundErr) {
return
}
if vConfigError != nil {
message.WarnErrf(vConfigError, lang.CmdViperErrLoadingConfigFile, vConfigError.Error())
return
}
Expand Down

0 comments on commit ee60eb8

Please sign in to comment.