-
Notifications
You must be signed in to change notification settings - Fork 539
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
makes exec_auth spawn the command asynchronously #2046
makes exec_auth spawn the command asynchronously #2046
Conversation
Many thanks for your review. I've made the changes and pushed a new commit |
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.
A couple of minor comments, but LGTM other than that.
src/exec_auth.ts
Outdated
subprocess.stdout.setEncoding('utf8'); | ||
subprocess.stderr.setEncoding('utf8'); | ||
|
||
subprocess.stdout.on('data', (data: Buffer | string) => { |
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.
The Buffer
part of the type can be dropped now (not sure if TypeScript will complain about it though).
src/exec_auth.ts
Outdated
subprocess.stdout.on('data', (data: Buffer | string) => { | ||
stdoutData += data.toString('utf8'); |
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.
The toString()
call should be dropped now.
src/exec_auth.ts
Outdated
}); | ||
|
||
subprocess.stderr.on('data', (data) => { | ||
stderrData += data.toString('utf8'); |
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.
Same comment here about dropping the toString()
.
src/exec_auth.ts
Outdated
|
||
subprocess.on('error', (error) => { | ||
savedError = error; | ||
throw error; |
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.
I'm not sure that it still makes sense to throw here.
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.
my mistake, I forgot to remove it
LGTM, thanks! |
/lgtm Thanks for the PR! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, feloy The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR makes exec_auth calls
spawn
instead ofspawnSync
.This is cery useful for a GUI to continue working during the plugin is executed.
Fixes #2044