From 107e710c91a3a73e67d83ce3b2e7b5f6fa204c1f Mon Sep 17 00:00:00 2001 From: Oj Date: Fri, 21 Jan 2022 12:47:23 +0000 Subject: [PATCH] [Bootstrap] Tweak source to not duplicate argv handling code --- src/bootstrap.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bootstrap.js b/src/bootstrap.js index 84dcd90..2842b41 100644 --- a/src/bootstrap.js +++ b/src/bootstrap.js @@ -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); } -}; +}; \ No newline at end of file