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 != "" {
|
||||
viper.SetConfigFile(configFile)
|
||||
|
||||
// Assume YAML if the file has no extension.
|
||||
if filepath.Ext(configFile) == "" {
|
||||
viper.SetConfigType("yaml")
|
||||
}
|
||||
} else {
|
||||
r.setupConfigFileSearch()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user