From e549d0fd9c6675e11a08af96fdb4e04511389ef1 Mon Sep 17 00:00:00 2001 From: youngsterxyf Date: Wed, 27 Jan 2016 12:13:26 +0800 Subject: [PATCH] move some code piece --- config.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config.go b/config.go index 570faacb..e72f770c 100644 --- a/config.go +++ b/config.go @@ -124,6 +124,10 @@ func init() { workPath, _ = os.Getwd() workPath, _ = filepath.Abs(workPath) + if workPath != AppPath { + os.Chdir(AppPath) + } + BConfig = &Config{ AppName: "beego", RunMode: DEV, @@ -195,10 +199,6 @@ func init() { // now only support ini, next will support json. func parseConfig(appConfigPath string) (err error) { - if workPath != AppPath { - os.Chdir(AppPath) - } - AppConfig, err = newAppConfig(AppConfigProvider, appConfigPath) if err != nil { return err