1
0
鏡像自 https://github.com/astaxie/beego.git 已同步 2025-07-12 10:21:00 +00:00

Merge pull request #2914 from AbelZhou/master

Add sys env feature
此提交包含在:
astaxie
2017-11-19 10:41:22 +08:00
提交者 GitHub
當前提交 348bf51a42

查看文件

@ -136,9 +136,13 @@ func init() {
if err != nil {
panic(err)
}
appConfigPath = filepath.Join(workPath, "conf", "app.conf")
var filename = "app.conf"
if os.Getenv("BEEGO_MODE") != "" {
filename = os.Getenv("BEEGO_MODE") + ".app.conf"
}
appConfigPath = filepath.Join(workPath, "conf", filename)
if !utils.FileExists(appConfigPath) {
appConfigPath = filepath.Join(AppPath, "conf", "app.conf")
appConfigPath = filepath.Join(AppPath, "conf", filename)
if !utils.FileExists(appConfigPath) {
AppConfig = &beegoAppConfig{innerConfig: config.NewFakeConfig()}
return