-
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
WriteConfig fails to write if file does not exist #433
Comments
I had similar issue too and filed as #430 and right now my workaround is like this,
I'm just hoping there is a better solution. |
Use |
I got same issue. |
This is a workaround for spf13/viper#433; once it is fixed, viper.WriteConfig should be able to create the config file if it does not exist.
This is a workaround for spf13/viper#433; once it is fixed, viper.WriteConfig should be able to create the config file if it does not exist.
This is a workaround for spf13/viper#433; once it is fixed, viper.WriteConfig should be able to create the config file if it does not exist.
Nope, it does not. So |
When a config file is set using SetConfigFile: – WriteConfig failed if the file did not already exist, – SafeWriteConfig did not use it. Fixes spf13#430 Fixes spf13#433 Signed-off-by: Yann Soubeyrand <[email protected]>
When a config file is set using SetConfigFile: – WriteConfig failed if the file did not already exist, – SafeWriteConfig did not use it. Fixes spf13#430 Fixes spf13#433 Signed-off-by: Yann Soubeyrand <[email protected]>
When a config file is set using SetConfigFile: – WriteConfig failed if the file did not already exist, – SafeWriteConfig did not use it. Fixes spf13#430 Fixes spf13#433 Signed-off-by: Yann Soubeyrand <[email protected]>
When a config file is set using SetConfigFile: – WriteConfig failed if the file did not already exist, – SafeWriteConfig did not use it. Fixes spf13#430 Fixes spf13#433 Signed-off-by: Yann Soubeyrand <[email protected]>
The new
WriteConfig
function ends up callingfindConfigFile
, which in turn checks whether the file exists. If it doesn't then it returns an error, which stops the config being written.The text was updated successfully, but these errors were encountered: