|
|
@ -11,6 +11,7 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
"github.com/gogits/gogs/models" |
|
|
|
"github.com/gogits/gogs/models" |
|
|
|
"github.com/gogits/gogs/modules/log" |
|
|
|
"github.com/gogits/gogs/modules/log" |
|
|
|
|
|
|
|
"github.com/gogits/gogs/modules/setting" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
var CmdUpdate = cli.Command{ |
|
|
|
var CmdUpdate = cli.Command{ |
|
|
@ -18,10 +19,15 @@ var CmdUpdate = cli.Command{ |
|
|
|
Usage: "This command should only be called by SSH shell", |
|
|
|
Usage: "This command should only be called by SSH shell", |
|
|
|
Description: `Update get pushed info and insert into database`, |
|
|
|
Description: `Update get pushed info and insert into database`, |
|
|
|
Action: runUpdate, |
|
|
|
Action: runUpdate, |
|
|
|
Flags: []cli.Flag{}, |
|
|
|
Flags: []cli.Flag{ |
|
|
|
|
|
|
|
cli.StringFlag{"config, c", "custom/conf/app.ini", "Configuration file", ""}, |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func runUpdate(c *cli.Context) { |
|
|
|
func runUpdate(c *cli.Context) { |
|
|
|
|
|
|
|
if c.IsSet("config") { |
|
|
|
|
|
|
|
setting.CustomConf = c.String("config") |
|
|
|
|
|
|
|
} |
|
|
|
cmd := os.Getenv("SSH_ORIGINAL_COMMAND") |
|
|
|
cmd := os.Getenv("SSH_ORIGINAL_COMMAND") |
|
|
|
if cmd == "" { |
|
|
|
if cmd == "" { |
|
|
|
return |
|
|
|
return |
|
|
|