Skip to content
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

fix: chain promise on stream close #16

Merged
merged 1 commit into from
Apr 21, 2022
Merged

Conversation

EverlastingBugstopper
Copy link
Owner

originally opened by @EricCrosson but the lints failed, wanted to get this in though since it's super important and helpful

Copy link

@EricCrosson EricCrosson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aha, so I had used some dirty dirty tabs! 🙀 I had it comin' 😁

Thanks for reviving this PR!

@@ -62,7 +62,13 @@ class Binary {

return axios({ ...fetchOptions, url: this.url, responseType: "stream" })
.then(res => {
res.data.pipe(tar.x({ strip: 1, C: this.installDirectory }));
return new Promise((resolve, reject) => {
const sink = res.data.pipe(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! I had to double-check that pipe returns the Writable, but the docs indicate that it does 👍

Base automatically changed from avery/refactor to main April 21, 2022 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants