Browse Source

allow to specify WorkDir via env var

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
pull/1284/head
Vasiliy Tolstov 10 years ago
parent
commit
aa5f077f78
  1. 8
      modules/setting/setting.go

8
modules/setting/setting.go

@ -162,8 +162,12 @@ 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) {
execPath, err := ExecPath() work := os.Getenv("WORK_DIR")
return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err if len(work) == 0 {
execPath, err := ExecPath()
return path.Dir(strings.Replace(execPath, "\\", "/", -1)), err
}
return work, nil
} }
func forcePathSeparator(path string) { func forcePathSeparator(path string) {

Loading…
Cancel
Save