提交 cb5fd496 编写于 作者: C coseyo

fix conf load bug

上级 0f85c82a
...@@ -180,9 +180,10 @@ func init() { ...@@ -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
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册