[Bootstrap] Tweak source to not duplicate argv handling code

This commit is contained in:
Ducko 2022-01-21 12:47:23 +00:00
parent 37877bd7fb
commit 107e710c91
1 changed files with 2 additions and 3 deletions

5
src/bootstrap.js vendored
View File

@ -128,7 +128,6 @@ const startUpdate = () => {
});
};
const hasArgvFlag = (flag) => (process.argv || []).slice(1).includes(flag);
module.exports = () => {
// Paths logging
@ -140,7 +139,7 @@ getModuleDataPath: ${paths.getModuleDataPath()}
getInstallPath: ${paths.getInstallPath()}`);
const instanceLock = app.requestSingleInstanceLock();
const allowMultiInstance = hasArgvFlag('--multi-instance') || oaConfig.multiInstance === true; // argv flag or config
const allowMultiInstance = argv.hasFlag('--multi-instance') || oaConfig.multiInstance === true; // argv flag or config
console.log(instanceLock, allowMultiInstance);
@ -154,4 +153,4 @@ getInstallPath: ${paths.getInstallPath()}`);
} else {
app.once('ready', startUpdate);
}
};
};