Use download file API in MobileBuildsPlugin

Summary:
Facenook:
Use downloadFile API in Mobile Builds plugin

Reviewed By: mweststrate

Differential Revision: D32922041

fbshipit-source-id: d554ed9287af3bda4329e87732ab4de67136c0d2
This commit is contained in:
Andrey Goncharov
2021-12-10 06:34:37 -08:00
committed by Facebook GitHub Bot
parent 92f0ed67f4
commit 6aa0cef927
3 changed files with 9 additions and 4 deletions

View File

@@ -55,7 +55,10 @@ export const commandDownloadFileStartFactory =
maxRedirects,
headers,
});
const totalSize = response.headers['content-length'] ?? 0;
let totalSize = parseInt(response.headers['content-length'], 10);
if (Number.isNaN(totalSize)) {
totalSize = 0;
}
const writeStream = response.data.pipe(
createWriteStream(dest, {autoClose: true}),