testing exit codes

This commit is contained in:
Shane C 2024-07-04 16:46:29 -04:00
parent f9f879e7ee
commit 3a9d03a46f
Signed by: shane
GPG key ID: E46B5FEA35B22FF9

View file

@ -40,6 +40,7 @@ func (cmd *LinuxCommand) Run() error {
if err := command.Start(); err != nil {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
fmt.Println(exitErr.ExitCode())
if exitErr.ExitCode() == 127 {
return ErrCommandNotFound
} else {
@ -51,6 +52,7 @@ func (cmd *LinuxCommand) Run() error {
if err := command.Start(); err != nil {
var exitErr *exec.ExitError
if errors.As(err, &exitErr) {
fmt.Println(exitErr.ExitCode())
if exitErr.ExitCode() == 127 {
return ErrCommandNotFound
} else {