Skip to content

Commit 9987e63

Browse files
authored
fix: Ensure non-zero exit code on 'asc' compile failure (#2312)
1 parent 3f5a62b commit 9987e63

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: bin/asc.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,17 @@ if ((!hasSourceMaps || ~posCustomArgs) && !isDeno) {
1919
nodeArgs.push(...args.slice(posCustomArgs + 1));
2020
args.length = posCustomArgs;
2121
}
22-
(await import("child_process")).spawnSync(
22+
const { status, signal } = (await import("child_process")).spawnSync(
2323
nodePath,
2424
[...nodeArgs, thisPath, ...args],
2525
{ stdio: "inherit" }
2626
);
27+
if (status || signal) process.exitCode = 1;
2728
} else {
28-
const { error } = (await import("../dist/asc.js")).main(process.argv.slice(2), {
29+
const apiResult = (await import("../dist/asc.js")).main(process.argv.slice(2), {
2930
stdout: process.stdout,
3031
stderr: process.stderr
3132
});
33+
const { error } = await apiResult;
3234
if (error) process.exitCode = 1;
3335
}

0 commit comments

Comments
 (0)