Repository navigation
fix(shims): do not record the platform for --help/--version calls - #16
Merged
Merged
Conversation
is_install_command skips flags to find the subcommand, so `yarn
--version` and `yarn --help` looked like a bare `yarn` (an install) and
rewrote node_modules' platform marker. In local mode that recorded the
host platform over a container install and hid a real mismatch. `npm
install --help` and `pnpm add -h` had the same problem.
Treat any call with --help/-h/--version/-v as not an install. A bare
`yarn` or `yarn --frozen-lockfile` is still an install.
Verified: extended unit test fails before ("marker rewritten by: yarn
--version") and passes after; new test pins that bare yarn still
records the marker. bats test/unit 38/38, shellcheck clean.
Generated-with: Claude Code
Claude-Session: https://claude.ai/code/session_015QijPSQw2k943Mg36FYjYS
gpmayorga
marked this pull request as ready for review
November 28, 2026 11:07
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.
What changed
is_install_commandnow returns false for any call that carries--help,-h,--versionor-v, before it looks for the subcommand.Why
Reported in #10 (bug 3). The function skips flags to find the subcommand, so
yarn --versionandyarn --helplooked like a bareyarn(an install) and rewrote the node_modules platform marker. InNODE_SHIMS_MODE=localthat recorded the host platform over a container install, hiding a real mismatch and causing false warnings later.npm install --helpandpnpm add -hhad the same issue.Verification
yarn --version,yarn -v,yarn --help,npm install --help,pnpm add -h,npm i --versionleave an existing marker untouched. Fails before the fix (marker rewritten by: yarn --version), passes after.yarnandyarn --frozen-lockfilestill record the marker.bats test/unit38/38,shellcheck -S warningclean.AI-drafted (Claude Code); not yet reviewed by a human.
Generated by Claude Code