summaryrefslogtreecommitdiffstats
path: root/src/util/util_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/util_unix.go')
-rw-r--r--src/util/util_unix.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/util/util_unix.go b/src/util/util_unix.go
new file mode 100644
index 00000000..dcc5cb5e
--- /dev/null
+++ b/src/util/util_unix.go
@@ -0,0 +1,17 @@
+// +build !windows
+
+package util
+
+import (
+ "os"
+ "os/exec"
+)
+
+// ExecCommand executes the given command with $SHELL
+func ExecCommand(command string) *exec.Cmd {
+ shell := os.Getenv("SHELL")
+ if len(shell) == 0 {
+ shell = "sh"
+ }
+ return exec.Command(shell, "-c", command)
+}