From cb5fd49612a57837555f0486cee1f3db140d1daa Mon Sep 17 00:00:00 2001 From: coseyo Date: Fri, 22 Jan 2016 18:03:02 +0800 Subject: [PATCH] fix conf load bug --- config.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/config.go b/config.go index 8cf21530..e91ca28b 100644 --- a/config.go +++ b/config.go @@ -180,9 +180,10 @@ func init() { // now only support ini, next will support json. func ParseConfig() (err error) { if AppConfigPath == "" { - if utils.FileExists(filepath.Join("conf", "app.conf")) { - AppConfigPath = filepath.Join("conf", "app.conf") - } else { + // initialize default configurations + AppPath, _ := filepath.Abs(filepath.Dir(os.Args[0])) + AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") + if !utils.FileExists(AppConfigPath) { AppConfig = &beegoAppConfig{config.NewFakeConfig()} return }