diff options
author | 无闻 <u@gogs.io> | 2015-02-08 20:22:02 -0500 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2015-02-08 20:22:02 -0500 |
commit | cd0ee35b3f887cc4ab6ba16cc2d955bfae607678 (patch) | |
tree | bbe4ad9e924700d35833daf4f681a568dad278f5 /routers | |
parent | 3a44143b81aa050f53d5e0e2c87d4a84345cd94e (diff) | |
parent | 1ab09e4f1b27789121dfba9a6c6e4aa0011ab215 (diff) | |
download | gitea-cd0ee35b3f887cc4ab6ba16cc2d955bfae607678.tar.gz gitea-cd0ee35b3f887cc4ab6ba16cc2d955bfae607678.zip |
Merge pull request #905 from phsmit/conf_on_cli
Add option to provide configuration file on command line
Diffstat (limited to 'routers')
-rw-r--r-- | routers/install.go | 5 |
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 } |