Add work path CLI option (#6922)

Makes it possible to set the work path as a CLI option instead of
relying on environment variables which are somewhat opaque
This commit is contained in:
zeripath 2019-05-14 16:20:35 +01:00 committed by techknowlogick
parent 488d34691a
commit e55c874dd2
6 changed files with 25 additions and 9 deletions

View file

@ -479,7 +479,10 @@ func CheckLFSVersion() {
// SetCustomPathAndConf will set CustomPath and CustomConf with reference to the
// GITEA_CUSTOM environment variable and with provided overrides before stepping
// back to the default
func SetCustomPathAndConf(providedCustom, providedConf string) {
func SetCustomPathAndConf(providedCustom, providedConf, providedWorkPath string) {
if len(providedWorkPath) != 0 {
AppWorkPath = filepath.ToSlash(providedWorkPath)
}
if giteaCustom, ok := os.LookupEnv("GITEA_CUSTOM"); ok {
CustomPath = giteaCustom
}