Skip to content

Commit 533a39e

Browse files
authored
cli: fix missing binary exit code (#1130)
Exit 1 when the npm wrapper fails to spawn the Squawk binary. This can happen when `squawk-cli` is installed without running its `postinstall` script, so `js/install.js` never downloads `js/binaries/squawk`. For example, pnpm 10 requires dependency build scripts to be approved, Yarn 4.14+ disables third-party postinstalls by default, and npm supports `--ignore-scripts`. Tested: - `node --check js/bin/squawk` - missing binary: `node js/bin/squawk --version` exits 1 - present binary: `node js/bin/squawk --version` exits 0
1 parent bce3aab commit 533a39e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

js/bin/squawk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const child = childProcess.spawn(binaryPath, process.argv.slice(2), {
4242
child.on("error", err => {
4343
console.error("error: failed to invoke squawk")
4444
console.error(err.stack)
45+
process.exit(1)
4546
})
4647

4748
child.on("exit", code => {

0 commit comments

Comments
 (0)