mirror of https://github.com/spf13/viper.git
Avoid searching for config file in executable's path
Viper should not be searching for config.{json,toml,yaml,yml} in the directory where the `hugo` executable binary is located, i.e. do not try to look for e.g. $GOPATH/bin/config.toml or /usr/local/bin/config.toml
This commit is contained in:
parent
0c5f3e2462
commit
8b99f53550
8
viper.go
8
viper.go
|
@ -777,15 +777,9 @@ func (v *viper) findConfigFile() (string, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cwd, _ := findCWD()
|
|
||||||
file := v.searchInPath(cwd)
|
|
||||||
if file != "" {
|
|
||||||
return file, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// try the current working directory
|
// try the current working directory
|
||||||
wd, _ := os.Getwd()
|
wd, _ := os.Getwd()
|
||||||
file = v.searchInPath(wd)
|
file := v.searchInPath(wd)
|
||||||
if file != "" {
|
if file != "" {
|
||||||
return file, nil
|
return file, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue