1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 08:01:29 +00:00

Merge pull request #1603 from coseyo/remote_develop

fix conf load bug
This commit is contained in:
astaxie 2016-01-22 20:34:46 +08:00
commit af346e871b

View File

@ -180,9 +180,10 @@ func init() {
// now only support ini, next will support json. // now only support ini, next will support json.
func ParseConfig() (err error) { func ParseConfig() (err error) {
if AppConfigPath == "" { if AppConfigPath == "" {
if utils.FileExists(filepath.Join("conf", "app.conf")) { // initialize default configurations
AppConfigPath = filepath.Join("conf", "app.conf") AppPath, _ := filepath.Abs(filepath.Dir(os.Args[0]))
} else { AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
if !utils.FileExists(AppConfigPath) {
AppConfig = &beegoAppConfig{config.NewFakeConfig()} AppConfig = &beegoAppConfig{config.NewFakeConfig()}
return return
} }