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
Pruner should check for excluded files without considering to output_dir #1313
Comments
Background: I have a site with |
I believe the behavior you're witnessing is normal. As per Nanoc manual:
Now I would acknowledge there's an ambiguity in Nanoc's wording. The current behavior makes it In any case, the exclusion logic is implemented in terms of `String#include? so it's definitely loose and can't achieve what you're asking. Finally, given your additional example of having |
Right, but given that the exclude patterns are checked against each path component I cannot achieve that either. Adding |
I mean |
From my point of view it should only exclude Consider this:
|
Not possible, as each path component is checked against a pattern. What you suggested never is a component. For I remember a discussion we had earlier that I would prefer pruning to use globs. It allows for fine-grained control, is rather standard, but I do still believe these globs should be checked against paths below |
Having globs would certainly still be useful, though it wouldn’t fix this particular bug. Fix is coming up. |
Thank you! |
I'm sorry but it still doesn't work. I made a little repro: https://github.com/agross/nanoc-pruning Run |
Reopening! |
Looking good! |
Nice! That PR needs better test coverage, so I’ll spend a bit more time to finish it up and then release 4.9.2, hopefully this weekend. |
…-pruner Really ignore output_dir when checking for excludes in pruner
When a pattern excluded from pruning is contained in the
output_dir
config variable all files belowoutput_dir
get excluded.Steps to reproduce
output_dir: output
innanoc.yaml
(the default)prune.exclude: ['output']
innanoc yaml
touch output/something
nanoc prune --yes
Expected behavior
output/something
should be pruned.Actual behavior
output/something
remains.Details
When checking whether a file is excluded from pruning, the
output_dir
path component(s) should not be considered.The text was updated successfully, but these errors were encountered: