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