fix(pi-extension): run script/executable PLANNOTATOR_BROWSER paths directly on macOS - #1429
Open
punk-dev-robot wants to merge 1 commit into
Open
Conversation
…rectly on macOS open -a treats the value as an app bundle and fails with LaunchServices -10811 for script paths, with the error swallowed by the detached spawn. Mirror the binary's openBrowser branch: a value containing '/' that does not end with '.app' is executed directly with the URL as its argument. Fixes backnotprop#1391
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.
Fixes #1391.
On darwin the pi extension's
openBrowseralways ranopen -a $PLANNOTATOR_BROWSER <url>, treating the value as an app bundle. A script or executable path fails with LaunchServices error-10811, the error is swallowed by the detached spawn, and the extension reports "review opened" while nothing opens.This mirrors the branch the
plannotatorbinary already has inpackages/server/browser.ts: a value containing/that does not end with.appis executed directly with the URL as its argument; app names and.apppaths keep going throughopen -a.Changes
apps/pi-extension/server/network.ts: add the direct-exec branch for slash-containing non-.appPLANNOTATOR_BROWSERvalues on darwin.apps/pi-extension/server/network.test.ts: behavioral test —PLANNOTATOR_BROWSERpointing at a shell script gets executed with the URL as $1 (skipped on win32).Testing
bun test apps/pi-extension/server/network.test.ts— new test passes; the 3 pre-existing port-binding failures on my machine fail identically on a cleanmaincheckout (local environment, unrelated).