Support case-sensitive windows directories
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
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.
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.
Are there any plans to merge this PR? This is a hangup on npx and yarn.
#100