Repository navigation
Put a CLI's own bin directory first on its PATH, so an npm-installed codex can find node - #76
Open
AndrewYakovlev wants to merge 1 commit into
Open
AndrewYakovlev wants to merge 1 commit into
AndrewYakovlev wants to merge 1 commit into
Conversation
…codex finds the node beside it when amanu is launched as an app (gsamat#47). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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 #47.
When the app is opened normally, macOS gives it
PATH=/usr/bin:/bin:/usr/sbin:/sbin. An npm-installedcodexis a#!/usr/bin/env nodescript, so it exits with 127 even thoughToolingfinds it in/opt/homebrew/bin. Homebrew, nvm and mise all installnodein the same bin directory as the CLI.Subprocess.runSyncnow puts the executable's own directory first on the child's PATH. Both the--versionprobe and the real CLI runs go throughSubprocess.runSync, so one change fixes both.Tested with a new case in
SubprocessTests: a#!/usr/bin/envscript whose interpreter sits next to it. The test fails before the change and passes after it. The fullswift testrun passes, exceptMeetingLanguagesTests.restIsAlphabeticalAndUnique, which also fails onmasteron a Mac whose system language is Russian (localizedStandardCompareputs «Беларуская» before «Bosanski»).I have not reproduced this on a machine with npm-installed Codex.
🤖 Generated with Claude Code