summaryrefslogtreecommitdiffstats
path: root/routers/install.go
diff options
context:
space:
mode:
authorPeter Smit <peter@smitmail.eu>2015-02-05 12:12:37 +0200
committerPeter Smit <peter@smitmail.eu>2015-02-05 12:17:35 +0200
commit1ab09e4f1b27789121dfba9a6c6e4aa0011ab215 (patch)
tree59ec5e54ed44c41915217522ea37bebf24bd5797 /routers/install.go
parent02c5bade0fabc24b9b7c05a74c65965e2e53f687 (diff)
downloadgitea-1ab09e4f1b27789121dfba9a6c6e4aa0011ab215.tar.gz
gitea-1ab09e4f1b27789121dfba9a6c6e4aa0011ab215.zip
Add option to provide configuration file on command line
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/install.go b/routers/install.go
index 9c3f134d45..a3583a1a98 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -9,6 +9,7 @@ import (
"os"
"os/exec"
"path"
+ "path/filepath"
"strings"
"github.com/Unknwon/com"
@@ -221,8 +222,8 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
cfg.Section("security").Key("INSTALL_LOCK").SetValue("true")
cfg.Section("security").Key("SECRET_KEY").SetValue(base.GetRandomString(15))
- os.MkdirAll("custom/conf", os.ModePerm)
- if err := cfg.SaveTo(path.Join(setting.CustomPath, "conf/app.ini")); err != nil {
+ os.MkdirAll(filepath.Dir(setting.CustomConf), os.ModePerm)
+ if err := cfg.SaveTo(setting.CustomConf); err != nil {
ctx.RenderWithErr(ctx.Tr("install.save_config_failed", err), INSTALL, &form)
return
}