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

Exclude folder but include subdir does not work #25

Closed
nstaeger opened this issue Oct 14, 2014 · 1 comment · Fixed by #27
Closed

Exclude folder but include subdir does not work #25

nstaeger opened this issue Oct 14, 2014 · 1 comment · Fixed by #27

Comments

@nstaeger
Copy link

Hi,

lets pretend, I have the following folder structure:

system/
assets/
  |  one/
  |  two/
  |  three/
  |  ...
...

I would now like to stream over all files, but not the assets, but assets/two. In other words: I would like to have all files, except the asset files, that are in the subfolders one/, three/. I could do the following glob to do so:

[
  '**',
  '!assets/one/**',
  '!assets/three/**'
]

But if I would now add another folder within assets I would also need to add it as negative glob within my array. Much more intuitive would be the following glob:

[
  '**',
  '!assets/**',
  'assets/two/**'
]

But that one is not working. I cannot exclude a folder, and include a subfolder back in. But I think that would be very helpful. I am also using node-glob-all, which supports the second glob as expected. It seems like the structure of glob-stream does not support that kind of glob. Is that right? Or am I missing something out? Perhaps you would like to consider using node-glob-all in the future...

Best

PS: I am using gulp, which in the end uses your extension to load the files.

@UltCombo
Copy link
Contributor

I believe this is because glob-stream always processes negative globs last, so:

[
  '**',
  '!assets/**',
  'assets/two/**'
]

Is equivalent to:

[
  '**',
  'assets/two/**',
  '!assets/**'
]

Same issue as gulpjs/gulp#837

UltCombo added a commit to UltCombo/glob-stream that referenced this issue Dec 26, 2014
UltCombo added a commit to UltCombo/glob-stream that referenced this issue Dec 26, 2014
UltCombo added a commit to UltCombo/glob-stream that referenced this issue Dec 27, 2014
UltCombo added a commit to UltCombo/glob-stream that referenced this issue Dec 27, 2014
yocontra pushed a commit that referenced this issue Dec 28, 2014
Respect globs array order, fixes #25
phated pushed a commit that referenced this issue Feb 16, 2017
phated pushed a commit that referenced this issue Feb 16, 2017
Respect globs array order, fixes #25
phated pushed a commit that referenced this issue Feb 16, 2017
phated pushed a commit that referenced this issue Feb 16, 2017
Respect globs array order, fixes #25
phated pushed a commit that referenced this issue Feb 16, 2017
phated pushed a commit that referenced this issue Feb 16, 2017
phated pushed a commit that referenced this issue Feb 20, 2017
phated pushed a commit that referenced this issue Feb 21, 2017
phated pushed a commit that referenced this issue Feb 21, 2017
phated pushed a commit that referenced this issue Feb 21, 2017
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

Successfully merging a pull request may close this issue.

2 participants