Default to YAML when config file has no extension (#2618)
This commit is contained in:
parent
1bf82059f1
commit
ea1df6f164
@ -46,6 +46,11 @@ func (r *FileReader) Read() error {
|
|||||||
|
|
||||||
if configFile != "" {
|
if configFile != "" {
|
||||||
viper.SetConfigFile(configFile)
|
viper.SetConfigFile(configFile)
|
||||||
|
|
||||||
|
// Assume YAML if the file has no extension.
|
||||||
|
if filepath.Ext(configFile) == "" {
|
||||||
|
viper.SetConfigType("yaml")
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
r.setupConfigFileSearch()
|
r.setupConfigFileSearch()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user