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

Simpler exclusion pattern when globbing #25

Closed
aaronbushnell opened this issue Jan 17, 2014 · 5 comments
Closed

Simpler exclusion pattern when globbing #25

aaronbushnell opened this issue Jan 17, 2014 · 5 comments

Comments

@aaronbushnell
Copy link

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

[
  'app/**',
  '!app/{_tmp,_tmp/**}'
]

Just using this:

[
  'app/**',
  '!app/_tmp/**'
]

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

[
  'app/**',
  '!app/_tmp/'
]

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)

@isochronous
Copy link

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

@astericky
Copy link

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.

@adamvoss
Copy link

+1

@mark-zacharias
Copy link

+1

@isaacs
Copy link
Owner

isaacs commented Feb 21, 2015

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 as completed Feb 21, 2015
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

6 participants