Skip to content

Commit

Permalink
fix cannot write hidden file without extension (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
serazoli authored and sagikazarmark committed Sep 19, 2021
1 parent a1f26b1 commit fa3412d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ func (v *Viper) writeConfig(filename string, force bool) error {
var configType string

ext := filepath.Ext(filename)
if ext != "" {
if ext != "" && ext != filepath.Base(filename) {
configType = ext[1:]
} else {
configType = v.configType
Expand Down

0 comments on commit fa3412d

Please sign in to comment.