From 3031bdd1762bfb4a04fb36ea764e4c1209a5c9d8 Mon Sep 17 00:00:00 2001 From: coseyo Date: Sun, 24 Jan 2016 00:40:03 +0800 Subject: [PATCH] fix test error --- config.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config.go b/config.go index d090d247..ea329596 100644 --- a/config.go +++ b/config.go @@ -185,18 +185,17 @@ func ParseConfig() (err error) { workPath, _ := os.Getwd() workPath, _ = filepath.Abs(workPath) - if workPath != AppPath { - os.Chdir(AppPath) - } - if AppConfigPath == "" { // initialize default configurations AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") - if !utils.FileExists(AppConfigPath) { + if utils.FileExists(AppConfigPath) && workPath != AppPath { + os.Chdir(AppPath) + } else { AppConfig = &beegoAppConfig{config.NewFakeConfig()} return } } + AppConfig, err = newAppConfig(AppConfigProvider, AppConfigPath) if err != nil { return err