diff --git a/modules/setting/setting.go b/modules/setting/setting.go index aefc3520f..beb2233a7 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -162,8 +162,12 @@ func ExecPath() (string, error) { // WorkDir returns absolute path of work directory. func WorkDir() (string, error) { - execPath, err := ExecPath() - return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err + work := os.Getenv("WORK_DIR") + if len(work) == 0 { + execPath, err := ExecPath() + return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err + } + return work, nil } func forcePathSeparator(path string) {