Add ability to specify command line switches in package.json
This commit is contained in:
parent
fd30ed0edd
commit
6d2ad5ae58
1 changed files with 13 additions and 0 deletions
|
@ -132,6 +132,19 @@ if (packageJson.desktopName != null) {
|
||||||
// Chrome 42 disables NPAPI plugins by default, reenable them here
|
// Chrome 42 disables NPAPI plugins by default, reenable them here
|
||||||
app.commandLine.appendSwitch('enable-npapi');
|
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.
|
// Set the user path according to application's name.
|
||||||
app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
|
app.setPath('userData', path.join(app.getPath('appData'), app.getName()));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue