aboutsummaryrefslogtreecommitdiffstats
path: root/routers/init.go
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-12-01 02:54:44 +0100
committerGitHub <noreply@github.com>2020-12-01 09:54:44 +0800
commit14e8ef9ecb7c79ba8adff6fee44fc9bfb669814c (patch)
tree0b00c99dd82b5a48d84d22fb50dcb36e6495324f /routers/init.go
parentbc455ed257a617bb1c033157578c4f864ff4d527 (diff)
downloadgitea-14e8ef9ecb7c79ba8adff6fee44fc9bfb669814c.tar.gz
gitea-14e8ef9ecb7c79ba8adff6fee44fc9bfb669814c.zip
Flip RUN_MODE detection in router (#13768)
Missed that part in https://github.com/go-gitea/gitea/pull/13765. It's already in the 1.13 backport so this forward-ports that change again.
Diffstat (limited to 'routers/init.go')
-rw-r--r--routers/init.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/routers/init.go b/routers/init.go
index 6434fa89ba..6f6c1cfcd6 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -43,13 +43,15 @@ import (
)
func checkRunMode() {
- switch setting.Cfg.Section("").Key("RUN_MODE").String() {
- case "prod":
+ switch setting.RunMode {
+ case "dev":
+ git.Debug = true
+ case "test":
+ git.Debug = true
+ default:
macaron.Env = macaron.PROD
macaron.ColorLog = false
setting.ProdMode = true
- default:
- git.Debug = true
}
log.Info("Run Mode: %s", strings.Title(macaron.Env))
}