Make sure CLI args are parsed correctly when spawning in OS X (#383)

The binary used when spawning the CLI in OS X during development is
`electron-prebuilt/disk/Electron.app/Contents/MacOS/Electron`.

To make sure we catch both `Electron` and `electron`, make the
executable name lowercase before comparing it.

Signed-off-by: Juan Cruz Viotti <jviottidc@gmail.com>
This commit is contained in:
Juan Cruz Viotti 2016-04-29 11:55:23 -04:00
parent 36bd696da9
commit 087a008d0d

View File

@ -130,7 +130,7 @@ module.exports = yargs
// Excluding the extension makes sure we cover cases
// like *.exe and *.cmd in Windows systems.
const executable = path.basename(argv[0], path.extname(argv[0]));
const executable = path.basename(argv[0], path.extname(argv[0])).toLowerCase();
if (executable === 'node' || executable === 'electron') {