diff options
author | 无闻 <joe2010xtmf@163.com> | 2014-04-10 14:38:48 -0400 |
---|---|---|
committer | 无闻 <joe2010xtmf@163.com> | 2014-04-10 14:38:48 -0400 |
commit | 8faa0dbcd77ec17bbf88041f46e2fc48f6ca6f31 (patch) | |
tree | 3dff34e53f34632532fd7a05e00e6f06b3e7fb82 /routers/install.go | |
parent | 2577940c30f6a6d15390974ab36f8c3d1e00f9f4 (diff) | |
parent | a4cbe79567072befd96cf1b7eb319de1e2809ca3 (diff) |
Merge pull request #70 from zhsso/git
Git
Diffstat (limited to 'routers/install.go')
-rw-r--r-- | routers/install.go | 7 |
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"} |