Skip to content

Commit b36434b

Browse files
Handle nonzero exit codes as errors (#49)
1 parent 2b4b4e9 commit b36434b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/execShell.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export function execShellSync(
1919
if (result.error) {
2020
throw result.error;
2121
}
22+
if (result.status !== 0) {
23+
throw new Error(`${file} failed with exit code ${result.status}.`);
24+
}
2225
return result.stdout;
2326
} else {
2427
return execFileSync(file, args, options);

0 commit comments

Comments
 (0)