Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Windows] File extension always in capital letters #48

Closed
Avaray opened this issue Apr 26, 2017 · 1 comment
Closed

[Windows] File extension always in capital letters #48

Avaray opened this issue Apr 26, 2017 · 1 comment

Comments

@Avaray
Copy link

Avaray commented Apr 26, 2017

Should be like that?

Example:
...\0.20.2\hugo.EXE
...\go1.8\bin\go.EXE
...\atom\bin\atom.CMD

^ this is console.log from my app. I didn't check CLI.

Edit:
I was trying to find source of problem in code of node-which.
Changing line 29 in which.js file did nothing.
pathExtExe = (opt.pathExt || process.env.PATHEXT || '.exe;.cmd;.bat;.com')

Edit:
I was playing more with that line 29.
It seems problem is related to process.env.PATHEXT and probably to Windows OS.
My temporary fix for that is to change that line to look like this:
pathExtExe = (opt.pathExt || '.exe;.cmd;.bat;.com' || process.env.PATHEXT)

@Avaray Avaray closed this as completed May 18, 2017
@isaacs
Copy link
Contributor

isaacs commented May 18, 2017

Your suggested change makes it not respect the PATHEXT environment variable at all, because '.exe;.cmd;.bat;.com' will always be truthy.

which will return the extensions in the format of the path extension option that it receives (either from the options object, or from the environment). Since Windows filesystems are case-insensitive, this is usually fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants