diff --git a/config.go b/config.go index ea329596f6d8bbb99ed574aeef9be258965dddda..3ceae12e962dcefd1e29e3e1302ceef1c923fcca 100644 --- a/config.go +++ b/config.go @@ -188,14 +188,16 @@ func ParseConfig() (err error) { if AppConfigPath == "" { // initialize default configurations AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") - if utils.FileExists(AppConfigPath) && workPath != AppPath { - os.Chdir(AppPath) - } else { + if !utils.FileExists(AppConfigPath) { AppConfig = &beegoAppConfig{config.NewFakeConfig()} return } } + if workPath != AppPath { + os.Chdir(AppPath) + } + AppConfig, err = newAppConfig(AppConfigProvider, AppConfigPath) if err != nil { return err