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

fix: incomplete binary with npm installation #2149

Merged
merged 1 commit into from
Dec 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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