node-which icon indicating copy to clipboard operation
node-which copied to clipboard

Support case-sensitive windows directories

Open Gudahtt opened this issue 7 years ago • 3 comments

Checks for both upper-case and lower-case file extensions. This is to support case-sensitive directories on Windows.

Mixed-case file extensions still won't work, but those are rare enough that I don't think it's worth the performance cost to check those as well.

Closes #57

Gudahtt avatar Aug 02 '18 04:08 Gudahtt

I didn't add tests for this fix, as I wasn't sure how. The per-directory case-sensitivity flag wasn't added until build 17093, which was fairly recent.

I tested it locally by editing the lines in test/basic.js where fixtures was deleted. I changed them to delete fixtures/foo.sh instead, leaving the directory. Then I created the fixtures directory and set the case-sensitivity flag on it using the command fsutil.exe file setCaseSensitiveInfo test/fixtures enable.

Once doing that, I added tests that would use process.env.PATHEXT (#58 ), and ran them. find when executable > with process.env.PATHEXT > foo was the failing test. It passed after making this change.

Gudahtt avatar Aug 02 '18 04:08 Gudahtt

I'm tempted to change this to use fs.readdir instead, but I'm not sure that would be a good idea. It would make this work for mixed-case file extensions, and would probably be faster for small directories. But for large directories (i.e. containing many files), this would be slower and would consume more memory.

Gudahtt avatar Aug 11 '18 22:08 Gudahtt

Are there any plans to merge this PR? This is a hangup on npx and yarn.

danielgary avatar Dec 06 '18 21:12 danielgary

#100

wraithgar avatar May 01 '23 17:05 wraithgar