From 6d2ad5ae5881c2d4af9b41a69eef3e5e83814b60 Mon Sep 17 00:00:00 2001 From: Kevin Jose Martin Date: Thu, 11 Feb 2016 15:34:19 -0500 Subject: [PATCH] Add ability to specify command line switches in package.json --- atom/browser/lib/init.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/atom/browser/lib/init.js b/atom/browser/lib/init.js index 272cebb..df0f1b6 100644 --- a/atom/browser/lib/init.js +++ b/atom/browser/lib/init.js @@ -132,6 +132,19 @@ if (packageJson.desktopName != null) { // Chrome 42 disables NPAPI plugins by default, reenable them here app.commandLine.appendSwitch('enable-npapi'); +// Add othercommand line switches +if (packageJson.commandLineSwitches) { + for (let i = 0; i < packageJson.commandLineSwitches.length; ++i) { + const option = packageJson.commandLineSwitches[i]; + + if (typeof option === 'string') { + app.commandLine.appendSwitch(option); + } else { + app.commandLine.appendSwitch(option[0], option[1]); + } + } +} + // Set the user path according to application's name. app.setPath('userData', path.join(app.getPath('appData'), app.getName())); -- 2.7.4