Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ require (
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
golang.org/x/sync v0.15.0
gopkg.in/yaml.v3 v3.0.1
mvdan.cc/sh/v3 v3.11.0
mvdan.cc/sh/v3 v3.12.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
mvdan.cc/sh/v3 v3.11.0 h1:q5h+XMDRfUGUedCqFFsjoFjrhwf2Mvtt1rkMvVz0blw=
mvdan.cc/sh/v3 v3.11.0/go.mod h1:LRM+1NjoYCzuq/WZ6y44x14YNAI0NK7FLPeQSaFagGg=
mvdan.cc/sh/v3 v3.12.0 h1:ejKUR7ONP5bb+UGHGEG/k9V5+pRVIyD+LsZz7o8KHrI=
mvdan.cc/sh/v3 v3.12.0/go.mod h1:Se6Cj17eYSn+sNooLZiEUnNNmNxg0imoYlTu4CyaGyg=
11 changes: 7 additions & 4 deletions internal/services/run/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package run

import (
"context"
"errors"
"fmt"
stdio "io"
"os"
Expand Down Expand Up @@ -61,8 +62,9 @@ func RunCmd(

err = runner.Run(ctx, prog)
if err != nil {
if code, isExit := interp.IsExitStatus(err); isExit {
return fmt.Errorf("command exited with non-zero status %d", code)
var exitStatus interp.ExitStatus
if errors.As(err, &exitStatus) {
return fmt.Errorf("command exited with non-zero status %w", exitStatus)
}
return fmt.Errorf("encountered an error executing command - %w", err)
}
Expand Down Expand Up @@ -121,8 +123,9 @@ func RunFile(

err = runner.Run(ctx, prog)
if err != nil {
if code, isExit := interp.IsExitStatus(err); isExit {
return fmt.Errorf("file execution exited with non-zero status %d", code)
var exitStatus interp.ExitStatus
if errors.As(err, &exitStatus) {
return fmt.Errorf("file execution exited with non-zero status %w", exitStatus)
}
return fmt.Errorf("encountered an error executing file - %w", err)
}
Expand Down