sindresorhus / globby

User-friendly glob matching
MIT License
2.49k stars 126 forks source link

Fix error when reading inaccessible directories with `gitignore: true` and `suppressErrors: true` #246

Closed fwouts closed 1 year ago

fwouts commented 1 year ago

Currently, using gitignore: true with suppressErrors: true still shows an error if globby encounters, for example, a directory without read access.

See the following repo for an example: https://github.com/fwouts/globby-eaccess-bug

This fixes the issue and adds a corresponding test. Other tests that rely on the same temporary directory are made serial so there is no race condition between them, as this new test changes the layout of that directory.

Let me know if any further adjustments are required :)

sindresorhus commented 1 year ago

Instead of making many of the tests serial, I would prefer to use a different temp directory. You could use https://github.com/sindresorhus/tempy

fwouts commented 1 year ago

Instead of making many of the tests serial, I would prefer to use a different temp directory. You could use https://github.com/sindresorhus/tempy

Sounds good, done.

sindresorhus commented 1 year ago

Looks like tests are failing on Windows.