diff options
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 19e9d689c2..1240448c10 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 } |