From 1ab09e4f1b27789121dfba9a6c6e4aa0011ab215 Mon Sep 17 00:00:00 2001 From: Peter Smit Date: Thu, 5 Feb 2015 12:12:37 +0200 Subject: Add option to provide configuration file on command line --- cmd/update.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'cmd/update.go') 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 -- cgit v1.2.3