-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Use execa for child_process calls #759
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hook empty emitter with p-finally, not "exit" event.
…ied' on windows because window sucks
dylang
reviewed
Apr 18, 2017
if (!exists) return callback(); | ||
|
||
// Note: if rimraf moves the location of its executable, this will need to be updated | ||
ChildProcessUtilities.spawn(require.resolve("rimraf/bin"), [filePath], {}, callback); | ||
ChildProcessUtilities.spawn("rimraf", ["--no-glob", trailingSlash(dirPath)], {}, callback); |
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.
This lost the require.resolve
, so it doesn't seem to work if rimraf
is not in your path or a top-level dependency.
Yeah, if you're using yarn to install lerna, it breaks compatibility with npm and does not link transitive binaries. I'll have a fix out soon.
… On Apr 17, 2017, at 19:21, Dylan Greene ***@***.***> wrote:
@dylang commented on this pull request.
In src/FileSystemUtilities.js:
> if (!exists) return callback();
- // Note: if rimraf moves the location of its executable, this will need to be updated
- ChildProcessUtilities.spawn(require.resolve("rimraf/bin"), [filePath], {}, callback);
+ ChildProcessUtilities.spawn("rimraf", ["--no-glob", trailingSlash(dirPath)], {}, callback);
This lost the require.resolve, so it doesn't seem to work if rimraf is not in your path or a top-level dependency.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
5 tasks
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
execa
gives us much more robust interface forchild_process
, with a Promise API that will make async/await much easier to migrate to.Notables
execa
makes calling dependency binaries a cinch.strong-log-transformer
pipes (timestamps available with an option).How Has This Been Tested?
Updated unit and integration tests, as well as local testing via
yarn link
.Types of changes
There are cleanups to the recent CLI refactoring; unfortunately they're too tightly coupled with the other changes in the PR.
Checklist: