1.4.2 - Added extra double quotes for binarypath
Closed this issue · 3 comments
When I run browserstack-local in Windows 10, I got error like Error: ENOENT: no such file or directory, unlink '"C:\Users\ivan.xue\Documents\Git\XXX\test\e2e\browserstack\BrowserStackLocal"'
After I looked into the code, I found that this.addArgs = function(options) in Local.js is different in 1.3.4 and 1.4.2.
In 1.3.4, it simply return the binarypath value like below
case 'binarypath': if(value) this.binaryPath = value; break;
While in 1.4.2, this function is updated like below
case 'binarypath': if(value) this.binaryPath = this.sanitizePath(value); break;
And in this function, extra double quotes are added. The birnary path is updated to """C:\Users\ivan.xue\Documents\Git\XXX\test\e2e\browserstack\BrowserStackLocal"""
this.sanitizePath = function(rawPath) { var doubleQuoteIfRequired = this.windows && !rawPath.match(/"[^"]+"/) ? '"' : ''; return doubleQuoteIfRequired + rawPath + doubleQuoteIfRequired; };
I've had the same issue. On our production environment I need to specify the path the BrowserStackLocal binary (so we don't download it), however when I do in my configuration file the quotes are being passed through to the spawn which fails. I had to strip the quotes in local.js:addArgs in order to get it to work.
@ivan-xue-prospa I ran into this issue today, and I had to revert to using Version 1.3.4. I saw that you closed this issue. Could I ask if you found a solution for this?
@bisaysavath We switched to use Cypress for our automation tests :)