Skip to content

Commit d5434e5

Browse files
committed
Pass the rewatch exit code through in wrapper script
1 parent 15ebdcb commit d5434e5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

cli/rewatch.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ import { rewatch_exe, bsc_exe } from "./common/bins.js";
77

88
const args = process.argv.slice(2);
99

10-
child_process.spawnSync(rewatch_exe, [...args, "--bsc-path", bsc_exe], {
11-
stdio: "inherit",
12-
});
10+
try {
11+
child_process.execFileSync(rewatch_exe, [...args, "--bsc-path", bsc_exe], {
12+
stdio: "inherit",
13+
});
14+
} catch (err) {
15+
if (err.status !== undefined) {
16+
process.exit(err.status); // Pass through the exit code
17+
} else {
18+
process.exit(1); // Generic error
19+
}
20+
}

0 commit comments

Comments
 (0)