File tree Expand file tree Collapse file tree 3 files changed +10
-7
lines changed
Expand file tree Collapse file tree 3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ require (
2929 golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
3030 golang.org/x/sync v0.15.0
3131 gopkg.in/yaml.v3 v3.0.1
32- mvdan.cc/sh/v3 v3.11 .0
32+ mvdan.cc/sh/v3 v3.12 .0
3333)
3434
3535require (
Original file line number Diff line number Diff line change @@ -251,5 +251,5 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV
251251gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
252252gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA =
253253gopkg.in/yaml.v3 v3.0.1 /go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM =
254- mvdan.cc/sh/v3 v3.11 .0 h1:q5h+XMDRfUGUedCqFFsjoFjrhwf2Mvtt1rkMvVz0blw =
255- mvdan.cc/sh/v3 v3.11 .0 /go.mod h1:LRM+1NjoYCzuq/WZ6y44x14YNAI0NK7FLPeQSaFagGg =
254+ mvdan.cc/sh/v3 v3.12 .0 h1:ejKUR7ONP5bb+UGHGEG/k9V5+pRVIyD+LsZz7o8KHrI =
255+ mvdan.cc/sh/v3 v3.12 .0 /go.mod h1:Se6Cj17eYSn+sNooLZiEUnNNmNxg0imoYlTu4CyaGyg =
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package run
22
33import (
44 "context"
5+ "errors"
56 "fmt"
67 stdio "io"
78 "os"
@@ -61,8 +62,9 @@ func RunCmd(
6162
6263 err = runner .Run (ctx , prog )
6364 if err != nil {
64- if code , isExit := interp .IsExitStatus (err ); isExit {
65- return fmt .Errorf ("command exited with non-zero status %d" , code )
65+ var exitStatus interp.ExitStatus
66+ if errors .As (err , & exitStatus ) {
67+ return fmt .Errorf ("command exited with non-zero status %w" , exitStatus )
6668 }
6769 return fmt .Errorf ("encountered an error executing command - %w" , err )
6870 }
@@ -121,8 +123,9 @@ func RunFile(
121123
122124 err = runner .Run (ctx , prog )
123125 if err != nil {
124- if code , isExit := interp .IsExitStatus (err ); isExit {
125- return fmt .Errorf ("file execution exited with non-zero status %d" , code )
126+ var exitStatus interp.ExitStatus
127+ if errors .As (err , & exitStatus ) {
128+ return fmt .Errorf ("file execution exited with non-zero status %w" , exitStatus )
126129 }
127130 return fmt .Errorf ("encountered an error executing file - %w" , err )
128131 }
You can’t perform that action at this time.
0 commit comments