-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow running local binaries #36
Conversation
Should it maybe be opt-in? |
Hum, I actually always wondered why it was opt-in in Execa? The cons I see are rather minor. Performance-wise, the OS will do Also, it passes the full On my machine, I have had The main pro is that executing binaries from your Also, not having an option would keep the API smaller. I am not sure why one would actually want to disable this feature? Am I missing something? |
See sindresorhus/execa#314 for context. Preferring local binaries for user scripts definitely makes sense, but for reusable packages, it's not that commonly used. And it may even cause problems if you want to execute a global binary, and then a different version exists locally in I don't feel strongly about it though and could be convinced otherwise. |
Thanks for pointing at this issue, my memory is bad! :) I just read through this PR and the several related issues. In Execa, the
Very good point. Calling binaries in a re-usable Node module should work in most (but not all) cases, but it seems like this is a bad pattern for the reasons you are mentioning. Probably not something we should encourage. On the other hand, it is probably always a good thing in user scripts or apps. But then the package size should not matter as much (except maybe in a serverless function) and users should prefer Execa instead.
Should we expose this under a boolean option, defaulting to |
35717ac
to
856a7c0
Compare
👍
Thought about it and couldn't come up with a better name, so yeah |
Done. 👍 |
test('options.preferLocal true can pass arguments to local npm binaries, ,', testLocalBinary, ','); | ||
test('options.preferLocal true can pass arguments to local npm binaries, space', testLocalBinary, ' '); | ||
test('options.preferLocal true can pass arguments to local npm binaries, *', testLocalBinary, '*'); | ||
test('options.preferLocal true can pass arguments to local npm binaries, ?', testLocalBinary, '?'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't have to be this PR, but maybe pass in the repeatable part of the titles here as a variable to reduce duplication.
Mentioned in #14.
This PR allows running locally installed binaries.