(command string, args ...string)
| 90 | } |
| 91 | |
| 92 | func runCommand(command string, args ...string) error { |
| 93 | cmd := exec.Command(command, args...) |
| 94 | stderr, err := cmd.StderrPipe() |
| 95 | if err != nil { |
| 96 | return fmt.Errorf("error getting stderr pipe: %v", err) |
| 97 | } |
| 98 | err = cmd.Start() |
| 99 | if err != nil { |
| 100 | return fmt.Errorf("error starting %s: %v", command, err) |
| 101 | } |
| 102 | |
| 103 | output, _ := io.ReadAll(stderr) |
| 104 | err = cmd.Wait() |
| 105 | if err != nil { |
| 106 | return fmt.Errorf("%s %v returned with error code %v due to: %v", command, args, err, string(output)) |
| 107 | } |
| 108 | return nil |
| 109 | } |
no test coverage detected