gulpjs / glob-stream

Readable streamx interface over anymatch.
MIT License
178 stars 53 forks source link

fix: Only traverse directories that can match the glob base #131

Closed phated closed 5 months ago

phated commented 5 months ago

This PR changes the walking logic to take into account the base of each glob instead of walking only the cwd. This allows globs that use an absolute path outside of the cwd or move gulpfiles into different directories (which causes the process.cwd() to be changed). We also need to only check the existence of a file against a singular glob. Both of these changes drastically speed up many cases of globbing.

Fixes #127 Fixes #129 Fixes #130

I still need to look into #128 because the issue isn't clear on what paths don't work, as the only error seems to indicate an absolute path outside of the cwd.