-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Open
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.
Description
Version
24.3.0
Platform
x64 windows
Subsystem
No response
What steps will reproduce the bug?
on windows
files structure
root
|_ a
| node_modules
let r = await glob("a/node_moduleS", {
cwd: "root",
})
let files = await Array.fromAsync(r)
console.log(files);
output
['a'\\node_moduleS`]
This is the first issue, the result preserves the original glob casing instead of the casing on the filesystem
expected
-['a'\\node_moduleS`]
+['a'\\node_modules`]
when we try to exclude with the actual casing on the filesystem
the exclude actually uses case aware, and in this case it fails to exclude the actual path
on the file system
let r = await glob("a/node_moduleS", {
cwd: "root",
exclude: ["a/node_modules"]
})
let files = await Array.fromAsync(r)
console.log(files);
output
[ 'a\\node_moduleS' ]
instead of the expected
- [ 'a\\node_moduleS' ]
+ []
How often does it reproduce? Is there a required condition?
always
What is the expected behavior? Why is that the expected behavior?
- globing should always return the actual casing from the filesystem
- if the glob pattern is case insensitive so should the exclude patterns.
- we should be able to configure the casing of the matcher because on windows we may have case sensitive file system too. see final note for the proposal of enhancement
What do you see instead?
- on windows the glob results are returned with the casing of the pattern instead of preserving the filesystem casing
- the exclude patterns are case sensitive
Additional information
Additionally I think the glob case sensitive should be configurable
either be explicitly
await glob("a/node_moduleS", {
cwd: "root",
casing: "default", // default - window case-insensitive , linux - case sensitive
// yes - case sensitive regardless of operation system
// no - case insensitive regardless of operation system
})
windows also supports case sensitive file system as you can see here
https://learn.microsoft.com/en-us/windows/wsl/case-sensitivity

Metadata
Metadata
Assignees
Labels
fsIssues and PRs related to the fs subsystem / file system.Issues and PRs related to the fs subsystem / file system.windowsIssues and PRs related to the Windows platform.Issues and PRs related to the Windows platform.