k3d/cli/run.go
Rishabh Gupta 29fced4ef7 Added version tags, separated command implementaitons, added wait and timeout
Signed-off-by: Rishabh Gupta <r.g.gupta@outlook.com>
2019-04-09 13:47:47 +05:30

19 lines
378 B
Go

package run
import (
"log"
"os"
"os/exec"
)
// runCommand accepts the name and args and runs the specified command
func runCommand(verbose bool, name string, args ...string) error {
if verbose {
log.Printf("Running command: %+v", append([]string{name}, args...))
}
cmd := exec.Command(name, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()
}