-
Notifications
You must be signed in to change notification settings - Fork 135
Open
Description
Description
The bugfix in #441 seems to have affected the way absolute negative patterns are treated on Windows. In v3.3.2, absolute negative patterns worked with or without a drive letter. In v3.3.3, absolute negative patterns do not work without a drive letter. I do not see anything in the documentation about requiring a drive letter for absolute paths in Windows, so I assume it should be ok to omit the drive letter in absolute paths. If my assumption is incorrect please let me know and I will close the issue.
Environment
OS: Windows 11
fast-glob: 3.3.3
Node: 22.14.0
Reproduction Code
const fg = require('fast-glob');
const options = { absolute: true };
const patternsWithDriveLetter = ['C:/Users/me/testfile.txt', '!C:/Users/me/testfile.txt'];
const patternsWithoutDriveLetter = ['/Users/me/testfile.txt', '!/Users/me/testfile.txt'];
console.log('with drive letter:', fg.sync(patternsWithDriveLetter, options));
console.log('without drive letter:', fg.sync(patternsWithoutDriveLetter, options));Reproduction steps
- Create file
C:\Users\me\testfile.txt - Run the above code
Expected Result
This is how it worked in v3.3.2
with drive letter: []
without drive letter: []
Actual Result
This is how it works in v3.3.3
with drive letter: []
without drive letter: [ 'C:/Users/me/testfile.txt' ]
kgregory, tianyingchun and decmbrs
Metadata
Metadata
Assignees
Labels
No labels