forked from kevadesu/forgejo
Add option to provide configuration file on command line
This commit is contained in:
parent
02c5bade0f
commit
1ab09e4f1b
8 changed files with 37 additions and 13 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue