Skip to content

fix(cli): exit with non-zero code when it fails to start#1449

Merged
Timeless0911 merged 2 commits intomainfrom
fix/cli-exit
Jan 22, 2026
Merged

fix(cli): exit with non-zero code when it fails to start#1449
Timeless0911 merged 2 commits intomainfrom
fix/cli-exit

Conversation

@Timeless0911
Copy link
Copy Markdown
Contributor

Summary

Ensure the CLI process exits with a non-zero exit code (1) when it fails to start.

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 11:36
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 pull request ensures that the Rslib CLI exits with a non-zero exit code (1) when it fails to start, making it properly detectable in CI/CD pipelines and scripts.

Changes:

  • Added process.exit(1) to the CLI error handler when startup fails
  • Simplified the runCliSync test helper by removing redundant error wrapping
  • Added integration test to verify CLI exits with code 1 on invalid options

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/core/src/cli/index.ts Added process.exit(1) to ensure non-zero exit code on CLI startup failure
tests/scripts/shared.ts Removed try-catch wrapper from runCliSync to allow native execSync error handling
tests/integration/cli/unknown-option/index.test.ts New test verifying CLI exits with status code 1 when unknown options are provided

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

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

cloudflare-workers-and-pages bot commented Jan 22, 2026

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6410e45
Status: ✅  Deploy successful!
Preview URL: https://02b6b9e8.rslib.pages.dev
Branch Preview URL: https://fix-cli-exit.rslib.pages.dev

View logs

@Timeless0911 Timeless0911 enabled auto-merge (squash) January 22, 2026 11:46
@Timeless0911 Timeless0911 merged commit 2ee645a into main Jan 22, 2026
12 checks passed
@Timeless0911 Timeless0911 deleted the fix/cli-exit branch January 22, 2026 11:48
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.

3 participants