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

Force exclusion first #10

Open
vladikoff opened this issue Mar 11, 2014 · 2 comments · May be fixed by #40
Open

Force exclusion first #10

vladikoff opened this issue Mar 11, 2014 · 2 comments · May be fixed by #40

Comments

@vladikoff
Copy link
Collaborator

Hey @cowboy, would it be possible to have something like this in the new version? :

['!node_modules', '**/*.js'] 
// everything in all directories, but not node_modules

This might be useful for Grunt. No worries if too complex to add.

@jonschlinkert
Copy link

I've thought about this as well.

In one of my projects I implemented an option to pass an array of excluded "root directories" (such as node_modules) to globule. then I use the difference between what fs.readdirSync() returns and and the excluded directories to build up the list of directories that should be "scanned". Then globule only expans file paths in the non-excluded directories. It's super fast (comparatively).

@cowboy would you consider a pr for this?

@efolio
Copy link

efolio commented Dec 12, 2014

I wonder if it would be possible to do this, but faster:
['sth/**/*.js', '!sth/**/*.spec.js]

It would be far better if the first glob could not catch the .spec.js files at once, instead of expanding both expressions in order to make the difference afterwards…

@doowb doowb linked a pull request Dec 22, 2017 that will close this issue
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.

3 participants