1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 04:50:54 +00:00

beego: hot fix for TestBeegoInit can't parsefile

This commit is contained in:
astaxie 2014-04-04 10:04:22 +08:00
parent f222f5b238
commit 8cbea70e07

View File

@ -238,6 +238,11 @@ func initBeforeHttpRun() {
func TestBeegoInit(apppath string) { func TestBeegoInit(apppath string) {
AppPath = apppath AppPath = apppath
AppConfigPath = filepath.Join(AppPath, "conf", "app.conf") AppConfigPath = filepath.Join(AppPath, "conf", "app.conf")
err := ParseConfig()
if err != nil && !os.IsNotExist(err) {
// for init if doesn't have app.conf will not panic
Info(err)
}
os.Chdir(AppPath) os.Chdir(AppPath)
initBeforeHttpRun() initBeforeHttpRun()
} }