Closed bdukes closed 9 years ago
Need the version of glob you are using directly. If it is latest, that is quite different
I had just done an npm install glob
for testing, which installed glob@5.0.15. Looking at glob-stream@5.0.0, I also just installed glob@5.0.3 (per https://github.com/gulpjs/glob-stream/blob/v5.0.0/package.json), and get the same results.
@bdukes cool. Can you also test glob using the on('match')
syntax to see if it is a bug with that?
@bdukes ref https://github.com/isaacs/node-glob#events
glob@5.0.3 works fine using on('match')
@bdukes can you please create a repo for reproduction that includes files and scripts? I have some time to look at this today
I've put a repro at https://dl.dropboxusercontent.com/u/5536031/glob-stream-nocase-repro.zip
Thanks! It seems this is only happening on window's and is related to us making the glob absolute. I think I will be able to track this into the glob library
:+1:
The example below has the same problem as described. Looks to be a node-glob issue.
var testGlob = new glob.Glob('C:\\Users\\phated\\Downloads\\glob-stream-nocase-repro\\testing\\**\\*.glob', { nocase: true });
testGlob.on('match', function (match) {
console.log('glob matched', match);
}).on('end', function () {
console.log('done matching via glob');
})
Found the issue already opened for this over on glob: https://github.com/isaacs/node-glob/issues/123
Going to close this as the bug is happening upstream and there isn't much we can do about it. You could probably poke some of the related threads. There seems to be a PR open that tries to solve it but is way out of date.
Using node-glob directly, I can match a file with a call like
However, using glob-stream, as soon as I pass
{ nocase: true }
, I get zero files in the steam (regardless of whether they match the case of the glob pattern or not). Passing{ nocase: false }
causes matches to show up again.The above code only shows
end
.I'm running node 4.1.1 on Windows 10, let me know if you need any other debug info.