Skip to content

Commit

Permalink
fix: config file search error
Browse files Browse the repository at this point in the history
  • Loading branch information
amone-bit committed Feb 7, 2024
1 parent 3924934 commit 85ce03a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions file.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ func (v *Viper) findConfigFile() (string, error) {
func (v *Viper) searchInPath(in string) (filename string) {
v.logger.Debug("searching for config in path", "path", in)
if v.configType != "" {
if b, _ := exists(v.fs, filepath.Join(in, v.configName)); b {
return filepath.Join(in, v.configName)
if b, _ := exists(v.fs, filepath.Join(in, v.configName+"."+v.configType)); b {
v.logger.Debug("found file", "file", filepath.Join(in, v.configName+"."+v.configType))
return filepath.Join(in, v.configName+"."+v.configType)
}
}

Expand Down

0 comments on commit 85ce03a

Please # to comment.