mirror of
https://github.com/spf13/viper
synced 2025-05-11 06:37:27 +00:00
fix cannot write hidden file without extension (#1017)
This commit is contained in:
parent
b56493f90a
commit
a5b23ef0de
1 changed files with 1 additions and 1 deletions
2
viper.go
2
viper.go
|
@ -1537,7 +1537,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
|
||||
|
|
Loading…
Add table
Reference in a new issue