mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
support condition to allow equals in chrome argument values
This commit is contained in:
parent
38b50bb9d6
commit
5d36864038
13
js/main.js
13
js/main.js
@ -146,7 +146,9 @@ function setChromeFlagsFromCommandLine() {
|
|||||||
cmdArgs.forEach((arg) => {
|
cmdArgs.forEach((arg) => {
|
||||||
// We need to check if the argument key matches the one
|
// We need to check if the argument key matches the one
|
||||||
// in the special args array and return if it does match
|
// in the special args array and return if it does match
|
||||||
const argKey = arg.split('=')[0];
|
const argSplit = arg.split('=');
|
||||||
|
const argKey = argSplit[0];
|
||||||
|
const argValue = argSplit[1] && arg.substring(arg.indexOf('=')+1);
|
||||||
if (arg.startsWith('--') && specialArgs.includes(argKey)) {
|
if (arg.startsWith('--') && specialArgs.includes(argKey)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -158,13 +160,12 @@ function setChromeFlagsFromCommandLine() {
|
|||||||
// Since chrome takes values after an equals
|
// Since chrome takes values after an equals
|
||||||
// We split the arg and set it either as
|
// We split the arg and set it either as
|
||||||
// just a key, or as a key-value pair
|
// just a key, or as a key-value pair
|
||||||
const argSplit = arg.split('=');
|
if (argKey && argValue) {
|
||||||
if (argSplit.length > 1) {
|
app.commandLine.appendSwitch(argKey.substr(2), argValue);
|
||||||
app.commandLine.appendSwitch(argSplit[0].substr(2), argSplit[1]);
|
|
||||||
} else {
|
} else {
|
||||||
app.commandLine.appendSwitch(argSplit[0].substr(2));
|
app.commandLine.appendSwitch(argKey);
|
||||||
}
|
}
|
||||||
log.send(logLevels.INFO, `Appended chrome command line switch ${argSplit[0]}`);
|
log.send(logLevels.INFO, `Appended chrome command line switch ${argKey} with value ${argValue}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user