diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-11 12:18:56 +0800 |
---|---|---|
committer | Lunny Xiao <xiaolunwen@gmail.com> | 2014-03-11 12:18:56 +0800 |
commit | 5b5d54621e6b17e65e1df9227ca1bd5a66ce86db (patch) | |
tree | a2f429c224d0eb3356a6b456ac8fbca0860d3b49 /modules | |
parent | f9907bbfa4368be7412ab3ade6be354225409652 (diff) | |
parent | 295cfd42aa7a3248c044abdc530a96b722fb5e6b (diff) |
Merge branch 'master' of github.com:gogits/gogs
Diffstat (limited to 'modules')
-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 } |