Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

fix(snapshot): use autoclose option on writestream #345

Merged
merged 1 commit into from
Dec 12, 2017
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
3 changes: 1 addition & 2 deletions snapshot/android/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down