()
| 22 | } |
| 23 | |
| 24 | func (e *Error) Error() string { |
| 25 | message := "" |
| 26 | if len(e.stdout) > 0 { |
| 27 | message += string(e.stdout) + "\n" |
| 28 | } |
| 29 | |
| 30 | var exitError *exec.ExitError |
| 31 | if errors.As(e.err, &exitError) && len(exitError.Stderr) > 0 { |
| 32 | message += string(exitError.Stderr) + "\n" |
| 33 | } |
| 34 | |
| 35 | return message + e.err.Error() |
| 36 | } |
| 37 | |
| 38 | func Exists(cmd string) bool { |
| 39 | _, err := exec.LookPath(cmd) |
no outgoing calls
no test coverage detected