BigBalli opened a new pull request, #694: URL: https://github.com/apache/cordova-cli/pull/694
## Summary Closes #540 — the CLI always exits with code 0 even when commands fail. Three root causes fixed: - **`bin/cordova`**: The `.catch()` handler sets `process.exitCode` but never calls `process.exit()`, so Node exits with 0 before the exit code takes effect. Added an explicit `process.exit(exitCode)` call. - **`src/cli.js` — unhandled rejections**: There is an `uncaughtException` handler but no `unhandledRejection` handler, so rejected promises that escape the chain silently exit with 0. Added a matching `unhandledRejection` handler that logs the error and exits with code 1. - **`src/cli.js` — `printHelp()`**: Returns `undefined` instead of a value, breaking the promise chain. Made it return the result of `help()`. ## Test plan - [x] `npm test` passes (68 specs, 0 failures, lint clean) - [ ] Manual: run `cordova build` in a directory with no project and verify exit code is non-zero 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
