feat(defer): expose EXIT_CODE special variable to defer: (#1762)

Co-authored-by: Dor Sahar <dorsahar@icloud.com>
This commit is contained in:
Andrey Nering
2024-08-14 22:53:14 -03:00
committed by GitHub
parent 35119c12ab
commit b259edeb65
8 changed files with 93 additions and 14 deletions

View File

@@ -90,14 +90,6 @@ func RunCommand(ctx context.Context, opts *RunCommandOptions) error {
return r.Run(ctx, p)
}
// IsExitError returns true the given error is an exis status error
func IsExitError(err error) bool {
if _, ok := interp.IsExitStatus(err); ok {
return true
}
return false
}
// Expand is a helper to mvdan.cc/shell.Fields that returns the first field
// if available.
func Expand(s string) (string, error) {