mirror of https://github.com/spf13/viper.git
fix cannot write hidden file without extension (#1017)
This commit is contained in:
parent
a1f26b11bd
commit
fa3412d7ea
2
viper.go
2
viper.go
|
@ -1581,7 +1581,7 @@ func (v *Viper) writeConfig(filename string, force bool) error {
|
||||||
var configType string
|
var configType string
|
||||||
|
|
||||||
ext := filepath.Ext(filename)
|
ext := filepath.Ext(filename)
|
||||||
if ext != "" {
|
if ext != "" && ext != filepath.Base(filename) {
|
||||||
configType = ext[1:]
|
configType = ext[1:]
|
||||||
} else {
|
} else {
|
||||||
configType = v.configType
|
configType = v.configType
|
||||||
|
|
Loading…
Reference in New Issue