fix home directory config not loading (#1282)

leverage `viper.SetConfigType("yaml")` to fix issue regarding home directory configuration failing to load.
This commit is contained in:
Rob Playford
2021-06-15 19:52:13 -06:00
committed by GitHub
parent 4590150168
commit 9a432671fd
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -246,6 +246,7 @@ func initConfig() {
// Search config in home directory with name ".cobra" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".cobra")
}
+1
View File
@@ -67,6 +67,7 @@ func initConfig() {
// Search config in home directory with name ".cobra" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".cobra")
}
+1
View File
@@ -73,6 +73,7 @@ func initConfig() {
// Search config in home directory with name ".testproject" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".testproject")
}
+1
View File
@@ -86,6 +86,7 @@ func initConfig() {
// Search config in home directory with name ".{{ .AppName }}" (without extension).
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
viper.SetConfigName(".{{ .AppName }}")
}