close
Skip to content
Open
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
Wait for end of copy until spawning tunnel
Fixes the 'spawn ETXTBSY' errors as reported in #209.
The patch is inspired from browserstack/browserstack-local-nodejs#19 (comment).
  • Loading branch information
Marius committed Sep 27, 2019
commit 01a7f4467ffede45efc3eda3b5aec25dd0525eab
10 changes: 5 additions & 5 deletions lib/local.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ var Tunnel = function Tunnel(key, port, uniqueIdentifier, config, callback) {
function(response) {
response.pipe(file);

response.on('end', function() {
file.on('close', function() {
fs.chmodSync(localBinary, 0700);
setTimeout(function() {
tunnelLauncher();
}, 100);
}).on('error', function(e) {
tunnelLauncher();
});

response.on('error', function(e) {
logger.info('Got error while downloading binary: ' + e.message);
throw new Error('Got error while downloading binary: ' + e.message);
});
Expand Down