This commit is contained in:
crusader 2017-09-21 10:22:15 +09:00
parent 9268cb8592
commit 71ce7f35b5

View File

@ -91,7 +91,13 @@ func Save(target interface{}, file string, overWrite bool) error {
return _c.Save(target, file, overWrite)
}
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
@ -101,8 +107,10 @@ func (c *config) getConfigFiles(files ...string) []string {
for _, file := range files {
// check configuration
if exists(file) {
results = append(results, file)
if absin, err := absPathify(file); nil == err {
if exists(absin) {
results = append(results, absin)
}
}
}