1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-26 05:01:28 +00:00

move some code piece

This commit is contained in:
youngsterxyf 2016-01-27 12:13:26 +08:00
parent c59a029ce7
commit e549d0fd9c

View File

@ -124,6 +124,10 @@ func init() {
workPath, _ = os.Getwd() workPath, _ = os.Getwd()
workPath, _ = filepath.Abs(workPath) workPath, _ = filepath.Abs(workPath)
if workPath != AppPath {
os.Chdir(AppPath)
}
BConfig = &Config{ BConfig = &Config{
AppName: "beego", AppName: "beego",
RunMode: DEV, RunMode: DEV,
@ -195,10 +199,6 @@ func init() {
// now only support ini, next will support json. // now only support ini, next will support json.
func parseConfig(appConfigPath string) (err error) { func parseConfig(appConfigPath string) (err error) {
if workPath != AppPath {
os.Chdir(AppPath)
}
AppConfig, err = newAppConfig(AppConfigProvider, appConfigPath) AppConfig, err = newAppConfig(AppConfigProvider, appConfigPath)
if err != nil { if err != nil {
return err return err