-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
negated match goes into subdirectories
- fixes #16
- Loading branch information
1 parent
7968c80
commit e2f2ea0
Showing
2 changed files
with
28 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e2f2ea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So correct me if I'm wrong, but doesn't this prevent ignores from matching directories at all? E.g. If I have a file structure
a/b/c/<files>
and I want to ignore everything inc
, Ignoring"a/b/c"
won't work? I'm not sure I like this change. It's definitely a breaking change anyway...Though I guess ignoring
a/b/c/**
would still work, and this does make it possible to distinguish between files and directories, so maybe it's not a bad change after all. Idk...e2f2ea0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing to consider is that this change does make having an ignore option in this library more a convenience than a necessity.
Prior to this change there were good performance reasons for having ignore functionality inside the library, since ignoring a directory would prevent
recursive-readdir
from recursing into that directory. With this change, recursive-readdir will recurse into the directory and calllstat
on all the files inside it regardless of whether those files are ignored or not. That sort of functionality could easily be implemented outside this library with a combination ofArray.prototype.filter
andminimatch
. It doesn't necessarily need to be in the library itself.Maybe an option should be exposed to determine what behavior to use? If we do that, and make
ignore
match directories by default, then the next version of this library wouldn't even need to be a major release, since it wouldn't have this breaking change.