fix(cli): exit with non-zero code when it fails to start#1449
Merged
Timeless0911 merged 2 commits intomainfrom Jan 22, 2026
Merged
fix(cli): exit with non-zero code when it fails to start#1449Timeless0911 merged 2 commits intomainfrom
Timeless0911 merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
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
runCliSynctest 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.
Deploying rslib with
|
| Latest commit: |
6410e45
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://02b6b9e8.rslib.pages.dev |
| Branch Preview URL: | https://fix-cli-exit.rslib.pages.dev |
fi3ework
approved these changes
Jan 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensure the CLI process exits with a non-zero exit code (1) when it fails to start.
Related Links
Checklist