Skip to content

Commit fa3412d

Browse files
serazolisagikazarmark
authored andcommitted
fix cannot write hidden file without extension (#1017)
1 parent a1f26b1 commit fa3412d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

viper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1581,7 +1581,7 @@ func (v *Viper) writeConfig(filename string, force bool) error {
15811581
var configType string
15821582

15831583
ext := filepath.Ext(filename)
1584-
if ext != "" {
1584+
if ext != "" && ext != filepath.Base(filename) {
15851585
configType = ext[1:]
15861586
} else {
15871587
configType = v.configType

0 commit comments

Comments
 (0)