Open OleksiyRudenko opened 4 years ago
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `run-p install:*(**)'
Thank you for your report. But it looks the error that /bin/sh
reported. So that error is not related to this package.
Ah, sorry.
When there are no scripts matching install: an error is thrown: ERROR: Task not found: "install:".
I find that this is the main part.
Yes, currently npm-run-all
throws an error to recognize typo if matched script was not found.
But I can see worth to not throw.
@mysticatea thank you for looking into this.
Just sharing my findings below hoping it might be of any use to you.
My expectation was that since npm-run-all
uses minimatch
under the hood and minimatch
mentions support for extglob the problem could be solved by means of extglob patterns. Seems like this is not the case and minimatch
supports only a subset of extglob. However it would be really nice to enjoy 0 or more
pattern.
ESLint team decided to add an option to suppress the error when no files matching the pattern found and there is recent pending PR to resolve the issue. Adding an explicit option to suppress the error (or to fire a warning instead) might also be helpful.
would be really nice to have this for monorepos.
When
package.json
contains the scripts as followsyarn install
does what is expected, i.e.install:sub-project
being executed.When there are no scripts matching
install:**
an error is thrown:ERROR: Task not found: "install:**"
.I tried a number of
extglob
patterns expecting thatminimatch
(assuming extglob is enabled) would support those. No luck. E.g."postinstall": "run-p install:*(**)"
results inWhy do I need this?
install:**
would install sub-projects dependencies in a monorepo. And I'd like to setup a monorepo boilerplate having no sub-projects mounted yet so that maintainers could add their sub-projects with the least hassle possible.A possible workaround is just to add
"install:void": ":",
script (effectively explicitno-op
shell command). Doesn't look really elegant though.Will appreciate any suggestions on this.