File tree 1 file changed +11
-2
lines changed
scripts/emulator-testing/emulators 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,17 @@ export abstract class Emulator {
75
75
const reader = resp . body . getReader ( ) ;
76
76
reader . read ( ) . then ( function readChunk ( { done, value } ) : any {
77
77
if ( done ) {
78
- downloadComplete ( ) ;
78
+ console . log ( 'Emulator download is done.' ) ;
79
+ writer . close ( err => {
80
+ if ( err ) {
81
+ downloadFailed (
82
+ `Failed to close the downloaded emulator file: ${ err } `
83
+ ) ;
84
+ }
85
+
86
+ console . log ( 'Closed downloaded emulator file.' ) ;
87
+ downloadComplete ( ) ;
88
+ } ) ;
79
89
} else {
80
90
writer . write ( value ) ;
81
91
return reader . read ( ) . then ( readChunk ) ;
@@ -92,7 +102,6 @@ export abstract class Emulator {
92
102
93
103
downloadPromise . then (
94
104
( ) => {
95
- console . log ( 'Download complete' ) ;
96
105
// Change emulator binary file permission to 'rwxr-xr-x'.
97
106
// The execute permission is required for it to be able to start
98
107
// with 'java -jar'.
You can’t perform that action at this time.
0 commit comments