Simpler exclusion pattern when globbing #25

aaronbushnell opened this Issue Jan 17, 2014 · 5 comments

6 participants


When I try to exclude a directory (and its files) from a glob, I need to write out the pattern like this:


Just using this:


would copy over the directory, but will not contain any files. While using this:


would copy over _tmp and its files.

Is there any way to simplify this pattern? It seems like just using '!app/_tmp/**' should be sufficient to exclude the directory entirely.

(Referencing gulpjs/gulp#165)


Or even 'app/!(_tmp)/**.


I was just about to ask this question myself. Then I saw this. Hopefully, this is something that can be added to make minimatch and by extension gulp easier to use going forward.


You can do explicit ignores with glob now, but this is not (and likely won't ever be) supported in minimatch.

glob('**', { ignore: 'app/{_tmp,_tmp/**}' }, cb)
@isaacs isaacs closed this Feb 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment