3092: vscode: fix binary is not functional on windows r=matklad a=Veetaha

This is my first approach to fix this error, need to double-check this on windows still...
Fixes #3087
Fixes #3090 

Co-authored-by: Veetaha <gerzoh1@gmail.com>
This commit is contained in:
bors[bot] 2020-02-11 09:07:23 +00:00 committed by GitHub
commit af9a9abbd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,8 +27,7 @@ export async function downloadFile(
readBytes += chunk.length; readBytes += chunk.length;
onProgress(readBytes, totalBytes); onProgress(readBytes, totalBytes);
}) })
.on("end", resolve)
.on("error", reject) .on("error", reject)
.pipe(fs.createWriteStream(destFilePath)) .pipe(fs.createWriteStream(destFilePath).on("close", resolve))
); );
} }