summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-05-14 16:20:35 +0100
committertechknowlogick <techknowlogick@gitea.io>2019-05-14 11:20:35 -0400
commite55c874dd2a6162a374a9fac46c55db57bd17c5f (patch)
tree0af648181cfc9c59aededfe0b56de21e79baf1dc /modules
parent488d34691ad79bae13320f3e831a7ff46c245a89 (diff)
downloadgitea-e55c874dd2a6162a374a9fac46c55db57bd17c5f.tar.gz
gitea-e55c874dd2a6162a374a9fac46c55db57bd17c5f.zip
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
Diffstat (limited to 'modules')
-rw-r--r--modules/setting/setting.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index d7f361c01e..461e394a62 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -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
}