Skip to content

Commit c44caf2

Browse files
authored
Pass the rewatch exit code through in wrapper script (#7565)
* Pass the rewatch exit code through in wrapper script * CHANGELOG
1 parent 15ebdcb commit c44caf2

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
# 12.0.0-alpha.15 (Unreleased)
1414

1515
#### :bug: Bug fix
16-
- ignore inferred arity in functions inside `%raw` functions, leaving to `%ffi` the responsibility to check the arity since it gives an error in case of mismatch. https://github.com/rescript-lang/rescript/pull/7542
16+
17+
- Ignore inferred arity in functions inside `%raw` functions, leaving to `%ffi` the responsibility to check the arity since it gives an error in case of mismatch. https://github.com/rescript-lang/rescript/pull/7542
18+
- Pass the rewatch exit code through in wrapper script. https://github.com/rescript-lang/rescript/pull/7565
1719

1820
#### :nail_care: Polish
1921

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)