summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-07 14:06:05 -0400
committerUnknwon <u@gogs.io>2015-09-07 14:06:05 -0400
commit32c12d553ce75f6b485ec352d2c7bedda836b46c (patch)
tree368191e78c693a523337b37630c405fd71381635
parentcc83043edc2ddda52d3cbd2748b0fb4fe6406369 (diff)
downloadgitea-32c12d553ce75f6b485ec352d2c7bedda836b46c.tar.gz
gitea-32c12d553ce75f6b485ec352d2c7bedda836b46c.zip
Able to use `GOGS_WORK_DIR` environment variable to specify work directory
-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