diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-10 23:03:17 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-10 23:03:17 -0400 |
commit | 6ce9d800d014f5d440271e628c538ce823bbe263 (patch) | |
tree | 5a34f667120bccf8e95a52dddf8ea49fcb8288f6 /modules/base/conf.go | |
parent | 52837e3d36658cd58076ee0b9d9d99800b5ade88 (diff) |
Add custom.ini
Diffstat (limited to 'modules/base/conf.go')
-rw-r--r-- | modules/base/conf.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/base/conf.go b/modules/base/conf.go index 19e9d689..1240448c 100644 --- a/modules/base/conf.go +++ b/modules/base/conf.go @@ -11,6 +11,7 @@ import ( "path" "path/filepath" + "github.com/Unknwon/com" "github.com/Unknwon/goconfig" ) @@ -36,11 +37,20 @@ func init() { os.Exit(2) } - cfgPath := filepath.Join(workDir, "conf", "app.ini") + cfgPathPrefix := filepath.Join(workDir, "conf") + cfgPath := filepath.Join(cfgPathPrefix, "app.ini") Cfg, err = goconfig.LoadConfigFile(cfgPath) if err != nil { fmt.Printf("Cannot load config file '%s'\n", cfgPath) os.Exit(2) } + + cfgPath = filepath.Join(cfgPathPrefix, "custom.ini") + if com.IsFile(cfgPath) { + if err = Cfg.AppendFiles(cfgPath); err != nil { + fmt.Printf("Cannot load config file '%s'\n", cfgPath) + os.Exit(2) + } + } Cfg.BlockMode = false } |