Skip to content

Commit

Permalink
Handle nonzero exit codes as errors (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanlabelle authored Jul 3, 2024
1 parent 2b4b4e9 commit b36434b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/execShell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export function execShellSync(
if (result.error) {
throw result.error;
}
if (result.status !== 0) {
throw new Error(`${file} failed with exit code ${result.status}.`);
}
return result.stdout;
} else {
return execFileSync(file, args, options);
Expand Down

0 comments on commit b36434b

Please sign in to comment.