Make CustomPath, CustomConf and AppWorkPath configurable at build (#6631)

This commit is contained in:
zeripath 2019-04-29 19:08:21 +01:00 committed by techknowlogick
parent ccf4783980
commit 8d0d7bc28d
17 changed files with 184 additions and 193 deletions

View file

@ -16,7 +16,6 @@ import (
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/private"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/urfave/cli"
@ -28,13 +27,6 @@ var (
Name: "hook",
Usage: "Delegate commands to corresponding Git hooks",
Description: "This should only be called by Git",
Flags: []cli.Flag{
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
},
Subcommands: []cli.Command{
subcmdHookPreReceive,
subcmdHookUpdate,
@ -67,12 +59,6 @@ func runHookPreReceive(c *cli.Context) error {
return nil
}
if c.IsSet("config") {
setting.CustomConf = c.String("config")
} else if c.GlobalIsSet("config") {
setting.CustomConf = c.GlobalString("config")
}
setup("hooks/pre-receive.log")
// the environment setted on serv command
@ -143,12 +129,6 @@ func runHookUpdate(c *cli.Context) error {
return nil
}
if c.IsSet("config") {
setting.CustomConf = c.String("config")
} else if c.GlobalIsSet("config") {
setting.CustomConf = c.GlobalString("config")
}
setup("hooks/update.log")
return nil
@ -159,12 +139,6 @@ func runHookPostReceive(c *cli.Context) error {
return nil
}
if c.IsSet("config") {
setting.CustomConf = c.String("config")
} else if c.GlobalIsSet("config") {
setting.CustomConf = c.GlobalString("config")
}
setup("hooks/post-receive.log")
// the environment setted on serv command