Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
fix: incomplete binary (#2149)
Browse files Browse the repository at this point in the history
closes #2148
  • Loading branch information
hrz6976 authored Dec 13, 2021
1 parent acfa2dd commit cd9d01e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion npm/binary-install.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,21 @@ class Binary {

return axios({ url: this.url, responseType: "stream" })
.then(res => {
res.data.pipe(tar.x({ strip: 1, C: this.binaryDirectory }));
const writer = tar.x({ strip: 1, C: this.binaryDirectory });

return new Promise((resolve, reject) => {
res.data.pipe(writer);
let error = null;
writer.on('error', err => {
error = err;
reject(err);
});
writer.on('close', () => {
if (!error) {
resolve(true);
}
});
})
})
.then(() => {
console.log(
Expand Down

0 comments on commit cd9d01e

Please # to comment.