fix: gracefully handle browser open failures #178
Merged
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.
Description
This PR improves the error handling when automatically opening the browser fails. Several users have reported issues with the
create-release-branch
tool failing when their terminal application lacks sufficient privileges for System Events or when using non-standard browsers like Brave.Instead of failing with an unclear osascript error, the tool now:
Testing Instructions
Prerequisites
Test Case 1: System Events Permission Disabled
First, test current behavior on main:
git checkout main yarn build // use package locally (eg: from Core repo) yarn && yarn create-release-branch -i
Disable System Events permission:
Test the fix:
git checkout fix/handle-macos-browser-open-permissions yarn build // use package locally (eg: from Core repo) yarn && yarn create-release-branch -i
Test Case 2: Non-standard Browser (Brave)
Set Brave as your default browser
Test current behavior on main:
git checkout main yarn build // use package locally (eg: from Core repo) yarn && yarn create-release-branch -i
Test the fix:
git checkout fix/handle-macos-browser-open-permissions yarn build // use package locally (eg: from Core repo) yarn && yarn create-release-branch -i
a) Browser opens successfully in Brave, or
b) Clear instructions to open the URL manually