diff options
author | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-06 13:21:49 -0500 |
---|---|---|
committer | Flu0r1ne <flur01ne@flu0r1ne.net> | 2021-09-06 13:21:49 -0500 |
commit | b3efa2051e3b0edf4001afa326c5bf8b1268f4fe (patch) | |
tree | 52b8d8e678773c6fde49c6a64d5b91ea21c630ac /dirtyscripting.go | |
parent | 40236ca7e4024a2a181a2de6d0bbc22a68487dc1 (diff) | |
download | planr-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.go | 10 |
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) +} |