gulpjs / glob-stream

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

fix: Don't follow circular symlinks #126

Closed joshhunt closed 5 months ago

joshhunt commented 6 months ago

Fixes the Error: ELOOP: too many symbolic links encountered exception that happens during the walkdir when the working directory contains circular symlinks.

I think this is the right logic to check this, and added some tests to try and catch the common scenarios.

phated commented 6 months ago

@joshhunt could we just check if the error is ELoop and bail?

joshhunt commented 6 months ago

@phated Could do. However, I think that's problematic because:

It's up to you which you would prefer, but I'm skeptical of just waiting for ELOOP.

I think the logic in this PR is good, but I'm struggling to come up with additional test cases to better validate it...

joshhunt commented 5 months ago

@phated I think this is in a good spot - open for feedback, other approaches, or scenarios to test!