mirror of
https://github.com/danog/gllvm.git
synced 2024-11-26 23:24:42 +01:00
18 lines
418 B
Go
18 lines
418 B
Go
package shared
|
|
|
|
import (
|
|
"os"
|
|
"os/exec"
|
|
)
|
|
|
|
// Executes a command then returns true for success, false if there was an error, err is either nil or the error.
|
|
func execCmd(cmdExecName string, args []string, workingDir string) (success bool, err error) {
|
|
cmd := exec.Command(cmdExecName, args...)
|
|
cmd.Stdout = os.Stdout
|
|
cmd.Stderr = os.Stderr
|
|
cmd.Dir = workingDir
|
|
err = cmd.Run()
|
|
success = (err == nil)
|
|
return
|
|
}
|