aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/mattn/go-shellwords/util_posix.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattn/go-shellwords/util_posix.go')
-rw-r--r--vendor/github.com/mattn/go-shellwords/util_posix.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/github.com/mattn/go-shellwords/util_posix.go b/vendor/github.com/mattn/go-shellwords/util_posix.go
index eaf1011d6..3aef2c4d7 100644
--- a/vendor/github.com/mattn/go-shellwords/util_posix.go
+++ b/vendor/github.com/mattn/go-shellwords/util_posix.go
@@ -9,9 +9,13 @@ import (
"strings"
)
-func shellRun(line string) (string, error) {
+func shellRun(line, dir string) (string, error) {
shell := os.Getenv("SHELL")
- b, err := exec.Command(shell, "-c", line).Output()
+ cmd := exec.Command(shell, "-c", line)
+ if dir != "" {
+ cmd.Dir = dir
+ }
+ b, err := cmd.Output()
if err != nil {
if eerr, ok := err.(*exec.ExitError); ok {
b = eerr.Stderr