1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Add option to provide configuration file on command line

This commit is contained in:
Peter Smit
2015-02-05 12:12:37 +02:00
parent 02c5bade0f
commit 1ab09e4f1b
8 changed files with 37 additions and 13 deletions

View File

@@ -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