summaryrefslogtreecommitdiffstats
path: root/src/util/util_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util_windows.go')
-rw-r--r--src/util/util_windows.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/util/util_windows.go b/src/util/util_windows.go
index a660f39e..3aa86606 100644
--- a/src/util/util_windows.go
+++ b/src/util/util_windows.go
@@ -5,6 +5,8 @@ package util
import (
"os"
"os/exec"
+
+ "github.com/junegunn/go-shellwords"
)
// ExecCommand executes the given command with $SHELL
@@ -13,5 +15,14 @@ func ExecCommand(command string) *exec.Cmd {
if len(shell) == 0 {
shell = "cmd"
}
- return exec.Command(shell, "/c", command)
+ args, _ := shellwords.Parse(command)
+ allArgs := make([]string, len(args)+1)
+ allArgs[0] = "/c"
+ copy(allArgs[1:], args)
+ return exec.Command(shell, allArgs...)
+}
+
+// IsWindows returns true on Windows
+func IsWindows() bool {
+ return true
}