Newer
Older
func RunCMD(c *cmd.Cmd) (err error, stdout, stderr []string) {
statusChan := c.Start()
status := <-statusChan
if status.Error != nil || status.Exit > 0 {
return fmt.Errorf("cannot execute command: %w", err), status.Stdout, status.Stderr
}
stdout = status.Stdout
stderr = status.Stderr
return
}