summaryrefslogtreecommitdiffstats
path: root/modules/setting/setting.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/setting/setting.go')
-rw-r--r--modules/setting/setting.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 7711ce3eb8..cbc2cc18e6 100644
--- a/modules/setting/setting.go
+++ b/modules/setting/setting.go
@@ -201,6 +201,11 @@ func ExecPath() (string, error) {
// WorkDir returns absolute path of work directory.
func WorkDir() (string, error) {
+ wd := os.Getenv("GOGS_WORK_DIR")
+ if len(wd) > 0 {
+ return wd, nil
+ }
+
execPath, err := ExecPath()
if err != nil {
return execPath, err