Skip to content

Commit ad6def0

Browse files
committed
JBDS-4041 cygwin installer fails to start with EBUSY error in install.log
Fix changes event listeners to 'close' and that fixes the issue.
1 parent 84bed1f commit ad6def0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

browser/model/helpers/downloader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class Downloader {
103103
.on('data', this.dataHandler.bind(this))
104104
.on('end', this.endHandler.bind(this, stream))
105105
.pipe(stream)
106-
.on('finish', this.closeHandler.bind(this,stream.path,sha,options));
106+
.on('close', this.closeHandler.bind(this,stream.path,sha,options));
107107
}
108108

109109
downloadAuth(options, username, password, file, sha) {
@@ -116,7 +116,7 @@ class Downloader {
116116
.on('data', this.dataHandler.bind(this))
117117
.on('end', this.endHandler.bind(this, stream))
118118
.pipe(stream)
119-
.on('finish', this.closeHandler.bind(this,stream.path,sha,options));
119+
.on('close', this.closeHandler.bind(this,stream.path,sha,options));
120120
}
121121

122122

browser/model/helpers/hash.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Hash {
1010
while (null !== (chunk = readStream.read())) {
1111
hash.update(chunk);
1212
}
13-
}).on('end', function () {
13+
}).on('close', function () {
1414
var hashstring = hash.digest('hex');
1515
done(hashstring);
1616
});

test/unit/model/helpers/hash-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ describe('Hash', function() {
3939
expect(createHashStub).to.have.been.calledWith('sha256');
4040
done();
4141
});
42-
stream.emit('end');
42+
stream.emit('close');
4343
});
4444

4545
it('should read the specified file', function(done) {
@@ -48,7 +48,7 @@ describe('Hash', function() {
4848
expect(readStreamStub).to.have.been.calledWith('file');
4949
done();
5050
});
51-
stream.emit('end');
51+
stream.emit('close');
5252
});
5353

5454
it('should create a hex string when the file is done reading', function(done) {
@@ -58,7 +58,7 @@ describe('Hash', function() {
5858
expect(spy).to.have.been.calledWith('hex');
5959
done();
6060
});
61-
stream.emit('end');
61+
stream.emit('close');
6262
});
6363
})
6464
});

0 commit comments

Comments
 (0)