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

MultiGlob requires at least one match? #19

Open
ericeslinger opened this issue Jul 7, 2014 · 3 comments
Open

MultiGlob requires at least one match? #19

ericeslinger opened this issue Jul 7, 2014 · 3 comments

Comments

@ericeslinger
Copy link

Is there a good reason for throwing the non-match error on line 221 in the multiGlob code? My specific use case is setting up a static-compiler to copy any miscellaneous .js files that get created in my main app tree.

Most work is done in coffeescript, so I build coffeescript into /scripts and then do a merge-trees on the static-compiler which pulls ['app/**/*.js', 'components/**/*.js','modules/**/*.js']. I'm doing this because I'm working with a developer who is learning javascript for the first time, whom I want to be able to contribute to the project without the overhead of also learning coffeescript. I know it's not really the best design strategy, but there it is. So, in future-proofing my Brocfile, I've found that unless there's at least one match for the multiGlob, It'll throw an exception which halts the entire build.

My workaround (which works fine for now) is to make sure that there is an empty foo.js file in each of the three trees, but that seems a bit excessive.

Would it be amiss to add an allowEmpty or some such option on the multiGlob options object? It's a bit weird, since that would be the only option that isn't there just to be passed in to node-glob. Alternatively, I'm not really certain why the exception needs to be thrown in the first place - are there other bits of functionality which would break if a multiglob returned an empty paths array?

@gkatsev
Copy link

gkatsev commented Oct 22, 2014

Any updates on this? I'm having the same issues. Trying to create a generic builder using broccoli that may or may not have some of the files and this keeps throwing errors.

@searls
Copy link

searls commented Dec 9, 2014

👍 -- would you be open to a pull request to add such an option?

@givanse
Copy link

givanse commented Aug 8, 2018

PR #35

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