|
@ -201,6 +201,11 @@ func ExecPath() (string, error) { |
|
|
|
|
|
|
|
|
// WorkDir returns absolute path of work directory.
|
|
|
// WorkDir returns absolute path of work directory.
|
|
|
func WorkDir() (string, error) { |
|
|
func WorkDir() (string, error) { |
|
|
|
|
|
wd := os.Getenv("GOGS_WORK_DIR") |
|
|
|
|
|
if len(wd) > 0 { |
|
|
|
|
|
return wd, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
execPath, err := ExecPath() |
|
|
execPath, err := ExecPath() |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return execPath, err |
|
|
return execPath, err |
|
|