Skip to content
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
13 changes: 11 additions & 2 deletions scripts/emulator-testing/emulators/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,17 @@ export abstract class Emulator {
const reader = resp.body.getReader();
reader.read().then(function readChunk({ done, value }): any {
if (done) {
downloadComplete();
console.log('Emulator download is done.');
writer.close(err => {
if (err) {
downloadFailed(
`Failed to close the downloaded emulator file: ${err}`
);
}

console.log('Closed downloaded emulator file.');
downloadComplete();
});
} else {
writer.write(value);
return reader.read().then(readChunk);
Expand All @@ -92,7 +102,6 @@ export abstract class Emulator {

downloadPromise.then(
() => {
console.log('Download complete');
// Change emulator binary file permission to 'rwxr-xr-x'.
// The execute permission is required for it to be able to start
// with 'java -jar'.
Expand Down
Loading