Skip to content

Commit ea1df6f

Browse files
authored
Default to YAML when config file has no extension (#2618)
1 parent 1bf8205 commit ea1df6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/config/reader.go

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func (r *FileReader) Read() error {
4646

4747
if configFile != "" {
4848
viper.SetConfigFile(configFile)
49+
50+
// Assume YAML if the file has no extension.
51+
if filepath.Ext(configFile) == "" {
52+
viper.SetConfigType("yaml")
53+
}
4954
} else {
5055
r.setupConfigFileSearch()
5156
}

0 commit comments

Comments
 (0)