Skip to content

Pass the rewatch exit code through in wrapper script #7565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
# 12.0.0-alpha.15 (Unreleased)

#### :bug: Bug fix
- 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

- 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
- Pass the rewatch exit code through in wrapper script. https://github.com/rescript-lang/rescript/pull/7565

#### :nail_care: Polish

Expand Down
14 changes: 11 additions & 3 deletions cli/rewatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ import { rewatch_exe, bsc_exe } from "./common/bins.js";

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

child_process.spawnSync(rewatch_exe, [...args, "--bsc-path", bsc_exe], {
stdio: "inherit",
});
try {
child_process.execFileSync(rewatch_exe, [...args, "--bsc-path", bsc_exe], {
stdio: "inherit",
});
} catch (err) {
if (err.status !== undefined) {
process.exit(err.status); // Pass through the exit code
} else {
process.exit(1); // Generic error
}
}