From 2d5d8ceb1de3467ab2914e45afcb8a2b3af26e3f Mon Sep 17 00:00:00 2001 From: barbowza Date: Wed, 13 Nov 2019 21:38:09 +0000 Subject: [PATCH] Desktop: Allow Electron debugging flag (#2084) * Add check for Electron's cli arg --remote-debugging-port and discard it to prevent cli arg parser raising Unknown flag exception. * Jump to next iteration once arg processed * Allow only the strict form of flag as --x=y --- ReactNativeClient/lib/BaseApplication.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ReactNativeClient/lib/BaseApplication.js b/ReactNativeClient/lib/BaseApplication.js index f21845458..e59682fc6 100644 --- a/ReactNativeClient/lib/BaseApplication.js +++ b/ReactNativeClient/lib/BaseApplication.js @@ -170,6 +170,12 @@ class BaseApplication { continue; } + if (arg.indexOf('--remote-debugging-port=') === 0) { + // Electron-specific flag used for debugging - ignore it. Electron expects this flag in '--x=y' form, a single string. + argv.splice(0, 1); + continue; + } + if (arg.length && arg[0] == '-') { throw new JoplinError(_('Unknown flag: %s', arg), 'flagError'); } else {