summaryrefslogtreecommitdiffstats
path: root/cmd/update.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 /cmd/update.go
parent02c5bade0fabc24b9b7c05a74c65965e2e53f687 (diff)
downloadgitea-1ab09e4f1b27789121dfba9a6c6e4aa0011ab215.tar.gz
gitea-1ab09e4f1b27789121dfba9a6c6e4aa0011ab215.zip
Add option to provide configuration file on command line
Diffstat (limited to 'cmd/update.go')
-rw-r--r--cmd/update.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/cmd/update.go b/cmd/update.go
index cc55693e2b..2ea7e942dd 100644
--- a/cmd/update.go
+++ b/cmd/update.go
@@ -11,6 +11,7 @@ import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/log"
+ "github.com/gogits/gogs/modules/setting"
)
var CmdUpdate = cli.Command{
@@ -18,10 +19,15 @@ var CmdUpdate = cli.Command{
Usage: "This command should only be called by SSH shell",
Description: `Update get pushed info and insert into database`,
Action: runUpdate,
- Flags: []cli.Flag{},
+ Flags: []cli.Flag{
+ cli.StringFlag{"config, c", "custom/conf/app.ini", "Configuration file", ""},
+ },
}
func runUpdate(c *cli.Context) {
+ if c.IsSet("config") {
+ setting.CustomConf = c.String("config")
+ }
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")
if cmd == "" {
return