index
:
gogs.git
Gogs is a painless self-hosted Git service
log msg
author
committer
range
buildscript
main
mygogs
about
summary
refs
log
tree
commit
diff
diff options
context:
1
2
3
4
5
6
7
8
9
10
15
20
25
30
35
40
space:
include
ignore
mode:
unified
ssdiff
stat only
author
Unknwon <u@gogs.io>
2015-09-07 14:06:05 -0400
committer
Unknwon <u@gogs.io>
2015-09-07 14:06:05 -0400
commit
32c12d553ce75f6b485ec352d2c7bedda836b46c
(
patch
)
tree
368191e78c693a523337b37630c405fd71381635
parent
cc83043edc2ddda52d3cbd2748b0fb4fe6406369
(
diff
)
Able to use `GOGS_WORK_DIR` environment variable to specify work directory
Diffstat
-rw-r--r--
modules/setting/setting.go
5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/setting/setting.go b/modules/setting/setting.go
index 7711ce3e..cbc2cc18 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