aboutsummaryrefslogtreecommitdiff
path: root/dirtyscripting.go
diff options
context:
space:
mode:
authorFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 13:21:49 -0500
committerFlu0r1ne <flur01ne@flu0r1ne.net>2021-09-06 13:21:49 -0500
commitb3efa2051e3b0edf4001afa326c5bf8b1268f4fe (patch)
tree52b8d8e678773c6fde49c6a64d5b91ea21c630ac /dirtyscripting.go
parent40236ca7e4024a2a181a2de6d0bbc22a68487dc1 (diff)
downloadplanr-b3efa2051e3b0edf4001afa326c5bf8b1268f4fe.tar.xz
planr-b3efa2051e3b0edf4001afa326c5bf8b1268f4fe.zip
Set individual cmd working dir rather than using chdir. Robust multithreading.
Diffstat (limited to 'dirtyscripting.go')
-rw-r--r--dirtyscripting.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/dirtyscripting.go b/dirtyscripting.go
index 9924d54..ee8531d 100644
--- a/dirtyscripting.go
+++ b/dirtyscripting.go
@@ -7,9 +7,7 @@ import (
"log"
)
-func RunCmd(name string, args ...string) {
- cmd := exec.Command(name, args...)
-
+func Exec(cmd * exec.Cmd) {
stderr, err := cmd.StderrPipe()
if err != nil {
log.Fatal(err);
@@ -40,3 +38,9 @@ func RunCmd(name string, args ...string) {
log.Fatalf("Could not execute cmake command\n%v", err)
}
}
+
+func RunCmd(name string, args ...string) {
+ cmd := exec.Command(name, args...)
+
+ Exec(cmd)
+}