From 8b99f53550a6de8be8d46a3c6ad2e0d03fa12a2d Mon Sep 17 00:00:00 2001 From: Anthony Fok Date: Thu, 22 Jan 2015 00:49:08 -0700 Subject: [PATCH] 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 --- viper.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/viper.go b/viper.go index 2d51b9b..750406b 100644 --- a/viper.go +++ b/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 wd, _ := os.Getwd() - file = v.searchInPath(wd) + file := v.searchInPath(wd) if file != "" { return file, nil }