summaryrefslogtreecommitdiff
path: root/vendor/github.com/mattn/go-shellwords/util_go15.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattn/go-shellwords/util_go15.go')
-rw-r--r--vendor/github.com/mattn/go-shellwords/util_go15.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/vendor/github.com/mattn/go-shellwords/util_go15.go b/vendor/github.com/mattn/go-shellwords/util_go15.go
new file mode 100644
index 000000000..180f00f0b
--- /dev/null
+++ b/vendor/github.com/mattn/go-shellwords/util_go15.go
@@ -0,0 +1,24 @@
+// +build !go1.6
+
+package shellwords
+
+import (
+ "os"
+ "os/exec"
+ "runtime"
+ "strings"
+)
+
+func shellRun(line string) (string, error) {
+ var b []byte
+ var err error
+ if runtime.GOOS == "windows" {
+ b, err = exec.Command(os.Getenv("COMSPEC"), "/c", line).Output()
+ } else {
+ b, err = exec.Command(os.Getenv("SHELL"), "-c", line).Output()
+ }
+ if err != nil {
+ return "", err
+ }
+ return strings.TrimSpace(string(b)), nil
+}