1
0
mirror of https://github.com/astaxie/beego.git synced 2024-06-26 02:14:13 +00:00

Merge pull request #4111 from liuhaogui/develop

添加配置文件路径环境变量
This commit is contained in:
Ming Deng 2020-07-30 09:14:12 +08:00 committed by GitHub
commit 7d561607d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -150,6 +150,9 @@ func init() {
filename = os.Getenv("BEEGO_RUNMODE") + ".app.conf"
}
appConfigPath = filepath.Join(WorkPath, "conf", filename)
if configPath := os.Getenv("BEEGO_CONFIG_PATH"); configPath != "" {
appConfigPath = configPath
}
if !utils.FileExists(appConfigPath) {
appConfigPath = filepath.Join(AppPath, "conf", filename)
if !utils.FileExists(appConfigPath) {