-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current directory used for config if no other specified directories exist #73
Comments
The two primary scenarios I see are:
It seems to be a separate issue, how to treat the lack of a config file - as an error or as a suppressed condition. This issue deals with that CWD should not be checked for config file unless either explicitly included in search locations. If no locations specified to begin with it may be a reasonable behaviour to check CWD. Although still a debatable use case it is not worth changing today, but would be great to hear opinions about. |
After fixing this issue the code which intentionally or not (like #104) relied on the default search in the current directory will break. To get the pre-fix functionality back in your application, add the following call to the proper viper callee after adding all other search paths to it: viper.AddConfigPath(".") |
As of 2015-08-16, Viper no longer searches the CWD for config file by default to avoid unintended surprises, but Hugo relies on the original behaviour. Fixed by calling viper.AddConfigPath(".") at the appropriate place. See spf13/viper#73 for more information. Fixes gohugoio#1363
As of 2015-08-16, Viper no longer searches the CWD for config file by default to avoid unintended surprises, but Hugo relies on the original behaviour. Fixed by calling viper.AddConfigPath(".") at the appropriate place. See spf13/viper#73 for more information. Fixes gohugoio#1363
It does not seem to be a problem if no directories were added with
AddConfigPath
- CWD is probably a good assumption.However, if config directories are misconfigured, or, more importantly, get accidentally erased later, then loading configuration from CWD is a surprise behaviour. I would expect a failure at that point.
Code example:
The text was updated successfully, but these errors were encountered: