fix: read updated shell shim paths - #137
Open
martinrrm wants to merge 1 commit into
Open
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3ff4d6b3-8027-46d4-9024-3bb9e4fc495c
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
Update the POSIX shell-shim parser to recognize the path form emitted by current versions of
cmd-shim.cmd-shim@9.0.1added support for invoking Windows executables from WSL. As part of that change, generated shebang-based shell shims began using:instead of:
read-cmd-shimcurrently recognizes only the original$basedirform. As a result, it reports newer, valid shell shims asENOTASHIM, even though they were generated bycmd-shim.This change extends the existing parser to accept the optional, literal
_winsuffix. It continues to support older shims and returns the same relative target path for both forms.Why this approach
The parser remains intentionally narrow:
$basedirand$basedir_winare recognized"$@"structure are still required.cmdand PowerShell parsing are unchangedThis restores compatibility with current
cmd-shimoutput without changing the public API or the result returned for existing shims.Compatibility
This is backward-compatible:
cmd-shimversions still use$basedirand remain supportedcmd-shim@9.0.1and newer can now be read through$basedir_winENOTASHIMTesting
cmd-shimdependencyRelated change
The updated shell-shim form was introduced by npm/cmd-shim#178.