bitovi / launchpad

NodeJS Browser Launcher
MIT License
46 stars 28 forks source link

Launchpad seems to scan entire C:\ drive with path queries on windows #106

Closed nicojs closed 5 years ago

nicojs commented 5 years ago

Hi 👋

When trying to pinpoint why web component tester (wct) takes forever to start locally on Windows, I stumbled across launchpad. It seems that wct by default tries to start all browsers. Several browsers cannot be found on there default locations, so launchpad is searching for them on disk. The problem is that it does so from the root of my C:\ drive. Is this by design? This seems pretty extensive! A single path query (a dir command on windows) takes about a minute to do on my current hardware:

nicojs@my-pc C:\
$ echo %time%
 6:50:58,14

nicojs@my-pc C:\
$ dir /s /b firefox.exe
C:\Program Files\Mozilla Firefox\firefox.exe

nicojs@my-pc C:\
$ echo %time%
 6:51:41,31

The cause can be found here:

https://github.com/bitovi/launchpad/blob/91d7782e48395af9367246bd8da148a5a84cd155/lib/local/platform/windows.js#L4-L5

My program files are located at C:\Program Files (x86). This makes the result of path.dirname('C:\Program Files (x86)') equal to C:\. Shouldn't the cwd be C:\Program Files (x86)' here?

justinbmeyer commented 5 years ago

Yeah, I think you are right. Good catch!