aboutsummaryrefslogtreecommitdiff
path: root/routers/install.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2014-04-10 22:22:18 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2014-04-10 22:22:18 +0800
commit88d873c67f2940325a2a7a8aa851372c9afb983d (patch)
tree53908c92ebc0dbce9ae935b72eb4b959d55a587c /routers/install.go
parent94c7278194694fec728b518d4390b03ba6c237a4 (diff)
parent6b30d9b0f27a8cb0961d52980a8e655d9a0bbda2 (diff)
Merge branch 'dev' of github.com:gogits/gogs into dev
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/install.go b/routers/install.go
index 1c4e6181..5d6c65ef 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -7,6 +7,7 @@ package routers
import (
"errors"
"os"
+ "os/exec"
"strings"
"github.com/Unknwon/goconfig"
@@ -27,6 +28,7 @@ func checkRunMode() {
switch base.Cfg.MustValue("", "RUN_MODE") {
case "prod":
martini.Env = martini.Prod
+ base.IsProdMode = true
case "test":
martini.Env = martini.Test
}
@@ -102,6 +104,11 @@ func Install(ctx *middleware.Context, form auth.InstallForm) {
return
}
+ if _, err := exec.LookPath("git"); err != nil {
+ ctx.RenderWithErr("Fail to test 'git' command: "+err.Error(), "install", &form)
+ return
+ }
+
// Pass basic check, now test configuration.
// Test database setting.
dbTypes := map[string]string{"mysql": "mysql", "pgsql": "postgres", "sqlite": "sqlite3"}