ac1340488d
Signed-off-by: Mrunal Patel <mrunalp@gmail.com> Change the sandbox directory path Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
19 lines
269 B
Go
19 lines
269 B
Go
package utils
|
|
|
|
import (
|
|
"bytes"
|
|
"os/exec"
|
|
)
|
|
|
|
func ExecCmd(name string, args ...string) (string, error) {
|
|
cmd := exec.Command(name, args...)
|
|
var out bytes.Buffer
|
|
cmd.Stdout = &out
|
|
|
|
err := cmd.Run()
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
return out.String(), nil
|
|
}
|