Fix generated shell scripts for Cygwin/MSYS2/MinGW#48
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR addresses issues with generating shell script shims on Cygwin, MSYS2, and MinGW environments, and also updates the NODE_PATH normalization logic required by pnpm.
- Introduces an isCygwin helper function for environment detection.
- Updates shell shim generation to handle MINGW and MSYS conditions.
- Adjusts the NODE_PATH normalization to differentiate between Cygwin (/proc/cygdrive) and Windows (/mnt) environments.
Files not reviewed (2)
- test/snapshots/e2e.test.js.snap: Language not supported
- test/snapshots/test.js.snap: Language not supported
Comments suppressed due to low confidence (1)
src/index.ts:675
- Verify that using '/proc/cygdrive' for Cygwin environments is consistent with all use cases and does not lead to unexpected path resolution issues, especially compared to the default '/mnt' behavior on Windows.
const posix = isWindows() ? split[i].split('\').join('/').replace(/^([^:\/]*):/, (_, $1) => `${isCygwin() ? '/proc/cygdrive' : '/mnt'}/${$1.toLowerCase()}`) : split[i]
zkochan
approved these changes
Apr 21, 2025
4 tasks
4 tasks
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.
Reference: npm#30
This PR is based on the PR above, and also fixes the
NODE_PATHpnpm additionally seems to rely on that npm does not.pnpm run testcompletes with no issues, though I am unsure how to build the entirety ofpnpmwith these changes for further testing.