Skip to content

Commit

Permalink
Default to YAML when config file has no extension (#2618)
Browse files Browse the repository at this point in the history
  • Loading branch information
donotnoot committed Feb 24, 2022
1 parent 1bf8205 commit ea1df6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/config/reader.go
Expand Up @@ -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()
}
Expand Down

0 comments on commit ea1df6f

Please sign in to comment.