From d82fd2f414ed08379278b1eb1b1bf5c34c4211ad Mon Sep 17 00:00:00 2001 From: plamen5kov Date: Tue, 12 Dec 2017 14:10:36 +0200 Subject: [PATCH] fix(snapshot): use autoclose option on writestream --- snapshot/android/utils.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snapshot/android/utils.js b/snapshot/android/utils.js index a83882c4..bcbb04aa 100644 --- a/snapshot/android/utils.js +++ b/snapshot/android/utils.js @@ -15,12 +15,11 @@ const downloadFile = (url, destinationFilePath) => const request = httpsGet(url, response => { switch (response.statusCode) { case 200: - const file = createWriteStream(destinationFilePath); + const file = createWriteStream(destinationFilePath, {autoClose: true}); file.on('error', function (error) { return reject(error); }); file.on("finish", function() { - file.close(); chmodSync(destinationFilePath, 0755); return resolve(destinationFilePath); });