Skip to content

fix(cli): exit with non-zero code when failed#898

Merged
9aoy merged 1 commit intomainfrom
fix/cli-exit-code
Jan 22, 2026
Merged

fix(cli): exit with non-zero code when failed#898
9aoy merged 1 commit intomainfrom
fix/cli-exit-code

Conversation

@9aoy
Copy link
Copy Markdown
Collaborator

@9aoy 9aoy commented Jan 22, 2026

Summary

should exit with non-zero code when CLI start failed.

image

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings January 22, 2026 10:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the CLI to exit with a non-zero exit code when the CLI fails to start, ensuring proper error reporting to the shell.

Changes:

  • Added process.exit(1) in the error handler of runCLI() function when setupCommands() fails
  • Added an end-to-end test to verify that the CLI exits with code 1 when an invalid option is provided

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/core/src/cli/index.ts Added process.exit(1) call in the catch block to exit with non-zero code when CLI setup fails
e2e/cli/index.test.ts Added test case to verify CLI exits with code 1 when an unknown option is provided

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying rstest with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3b7f0f3
Status: ✅  Deploy successful!
Preview URL: https://a2f77c4a.rstest.pages.dev
Branch Preview URL: https://fix-cli-exit-code.rstest.pages.dev

View logs

@9aoy 9aoy merged commit b0ff184 into main Jan 22, 2026
17 checks passed
@9aoy 9aoy deleted the fix/cli-exit-code branch January 22, 2026 11:15
@9aoy 9aoy mentioned this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants