-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
Feature Request : Add an option to skip script not found error #149
Comments
Can you explain the use case further? Why do you have wildcards with no subscripts? |
Essentially a I myself have used If I instead of |
Possibly open to the feature, but I don't have any interest in implementing it. |
Most of my projects are standardized / based on generators. When I generate the empty package, I generate a package.json script for all common tasks. for example "lint": "run-p 'lint:*'" (and for many tasks : lint, test, build, etc) This is helpful and safe because I only have to add new lines when adding a new tool, I do not have to modify any line (open / close principle) To sum up here are the cases when I have a wildcard considered as a success :
|
What if we just change the default behavior? (similar to mapping over an empty array) Would that break anything? |
So you mean that if the default behavior of the command would be : if no script is found the script shall exit with a 0 code ? For me, it would be great, I do not know for other use cases of other apps. Personally, I find this default behavior much more logic... |
I recently read "A Philosophy of Software Design" by John Ousterhout and have been mulling on some of the ideas in the book including:
A great chapter, and generally compelling argument in reducing errors when they can just be avoided. I think handling empty run globs similar to empty array methods is probably an acceptable way to go. True, if you change your glob string on accident, and now your sub-scripts don't get run, it won't throw an error, but thats likely to manifest in other more important errors. But either way, this is an old module and I'm sure there is someone out there who would disagree. I would rather change the behavior under a very minimal, easy to adapt breaking change that have to burden users with more flags. Anyone care to implement? |
Hi,
I am struggling with a problem when using wildcards ex: 'myscript:*'. At the moment if no script starting with myscript is found it throws an error.
The only workaround I found was to create an empty script but it is kind of hacky, and it creates noise in the package.json.
It would be nice to add an option to the cli to be able to ignore this kind of error.
Thanks in advance !
The text was updated successfully, but these errors were encountered: