]> source.dussan.org Git - gitea.git/commitdiff
Flip RUN_MODE detection in router (#13768)
authorsilverwind <me@silverwind.io>
Tue, 1 Dec 2020 01:54:44 +0000 (02:54 +0100)
committerGitHub <noreply@github.com>
Tue, 1 Dec 2020 01:54:44 +0000 (09:54 +0800)
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.

routers/init.go

index 6434fa89ba560aef25aef00599d50bba0d6d1fe4..6f6c1cfcd61bf0a12042d237b0bb783114333068 100644 (file)
@@ -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))
 }