jekyll-watch
jekyll-watch copied to clipboard
Anchor excludes to start of string. Fixes #44.
Before this change, excluding a directory (bin
) would also exclude posts
that include that name (scrubbing
), which is very unexpected.
While this may start listening to files that were previously ignored, it
more closely matches the behaviour of jekyll on it's initial build
(which would include scrubbing
). The consequences of being overly
aggressive on listening to changes seem less important than missing
something.
This change is a bandaid. A proper fix would be to unify with Jekyll's
exclusion logic (Jekyll::EntryFilter maybe?) to ensure they will always
be the same. In the meantime, it may be advisable to not include
Jekyll's exclude
config in the watchers ignore list and take the hit
of overly aggressive reloads. I leave that decision to someone more
experienced than I.
Can you please add a test case where you assert that a file is left alone that you intend to leave alone?
yeah I'll have a go, might not be until the weekend though
Please take a look now. There wasn't any prior art for this so I had to make something up. I changed the existing adjacent spec to be consistent with new method, though didn't change the entire file. (In general it does a lot of "check the config is set to what I wanted" rather than "does this config achieve the behaviour I want").
Yeesh, we really let this sit here a while. Sorry about that!
My initial hesitation (which is maybe why I didn't respond) is how this affects files in a subdirectory. If I want to ignore LICENSE
, then I want to ignore ./LICENSE
and ./site/LICENSE
etc. The tests didn't help me see whether that works.
If you're still interested in this PR, I'd gladly accept it if you can clarify my question above ☝️ . Thanks for your patience!