-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Metalsmith fails to ignore broken symbolic links #281
Comments
I haven't verified this yet, but it seems like this may be an upstream bug in Found an existing issue: jergason/recursive-readdir#42 |
So upon further investigation, it seems this issue is rather complex.
There are a few ways we could handle this.
All of these options (except maybe the third or fourth ones) would be a SemVer-major breaking change to both Metalsmith and Another thing to consider would be allowing the ignore matchers to be asynchronous, in case they end up needing more information from the filesystem before deciding whether or not to ignore a file. |
I have made a pull request to jergason/recursive-readdir#42. If it is approved, a new ignore function would need to be implemented in order to account for this case. |
If you decide against ignoring all broken symlinks, which is logical, than the patch above should work by mask or any other existing filter. It just should not throw before testing ignore rules. |
Now I discovered, that Metalsmith actually |
Are you sure that's not just a plugin doing that? I'm fairly sure Metalsmith only calls it on the source directory: https://github.com/segmentio/metalsmith/blob/c24385888bc9dd05d8d1714cda9c63bba949ab73/lib/index.js#L236 |
I was not sure about that, that might have been a plugin. For now I ended up using |
Candidate replacement library which may handle this case better: https://www.npmjs.com/package/readdirp |
It seems that Metalsmith is trying to
stat
everything in source dir before applying.ignore
. That is inconvenient when using Emacs, for example, which creates such symlinks for its own agenda. It also seems that applying.ignore
before.source
makes no difference.Error that fails the build
Steps to reproduce
.ignore
.build
The text was updated successfully, but these errors were encountered: