ing
This commit is contained in:
parent
9268cb8592
commit
71ce7f35b5
14
config.go
14
config.go
|
@ -91,7 +91,13 @@ func Save(target interface{}, file string, overWrite bool) error {
|
||||||
return _c.Save(target, file, overWrite)
|
return _c.Save(target, file, overWrite)
|
||||||
}
|
}
|
||||||
func (c *config) Save(target interface{}, file string, overWrite bool) error {
|
func (c *config) Save(target interface{}, file string, overWrite bool) error {
|
||||||
return marshalFile(target, file, overWrite)
|
var absPath string
|
||||||
|
var err error
|
||||||
|
if absPath, err = absPathify(file); nil != err {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return marshalFile(target, absPath, overWrite)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. file
|
// 1. file
|
||||||
|
@ -101,8 +107,10 @@ func (c *config) getConfigFiles(files ...string) []string {
|
||||||
|
|
||||||
for _, file := range files {
|
for _, file := range files {
|
||||||
// check configuration
|
// check configuration
|
||||||
if exists(file) {
|
if absin, err := absPathify(file); nil == err {
|
||||||
results = append(results, file)
|
if exists(absin) {
|
||||||
|
results = append(results, absin)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user