Skip to content
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

Not-globs seem to match everything. #67

Open
ericeslinger opened this issue Jun 7, 2016 · 5 comments
Open

Not-globs seem to match everything. #67

ericeslinger opened this issue Jun 7, 2016 · 5 comments

Comments

@ericeslinger
Copy link

I have a glob list that looks like:

    templates: ['**/*.html', '!**/*index.html'],

(angular templatecache, I don't want to template my index.html, just all the child html). The problem is this watcher actually fires on all file changes - I am 98% sure it's because the !**/*index.html matches almost all the files in my build tree (including .js files, .scss files, and so on). In other uses of arrays-of-minimatch, the notted conditions tend to be anded together with the regular conditions, like "match when (C1 or C2 or C3) AND (N4 and N5)" for something like ['C1', 'C2', 'C3', '!N4', '!N5'] if that makes sense.

@stefanpenner
Copy link
Collaborator

I like the described behavior, are there any existing node libs providing the set like behavior with globs?

@ericeslinger
Copy link
Author

This is how gulp.src behaves - negated globs are interpreted to be exclusions from any non-negated globs thus far in the array.

@dannyk08
Copy link

dannyk08 commented Jan 3, 2017

was this ever resolved?
I'm facing the same issue with gulp atm, I'd like to include everything in a folder but exclude specific files in such folder

@amasad
Copy link
Owner

amasad commented Jan 3, 2017

There is a new ignored option that @wtgtybhertgeghgtwtg implemented that uses anymatch under the hood that should cover this use case.

@dannyk08
Copy link

dannyk08 commented Jan 3, 2017

problems is that I'm using gulp-sane-watch.. I'll have to wait for an integration of the latest master into that plugin.
Thanks so much for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants