From 2b9e3c54c608643030d90ed0fde5acf2042e756a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 14 Feb 2019 02:24:35 -0800 Subject: [PATCH] Set up --no-launcher flag Summary: For future use to disable launcher loops. Reviewed By: jknoxville Differential Revision: D13979653 fbshipit-source-id: db56f7d71d7a4d1322cb36622313dbad4307396d --- src/utils/__tests__/processConfig.node.js | 3 +++ src/utils/processConfig.js | 4 ++++ static/index.js | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/utils/__tests__/processConfig.node.js b/src/utils/__tests__/processConfig.node.js index ad7c958df..41a18fed1 100644 --- a/src/utils/__tests__/processConfig.node.js +++ b/src/utils/__tests__/processConfig.node.js @@ -18,6 +18,7 @@ test('config is decoded from env', () => { lastWindowPosition: {x: 4, y: 8, width: 15, height: 16}, updaterEnabled: false, screenCapturePath: '/my/screenshot/path', + launcherEnabled: false, }); expect(config()).toEqual({ @@ -26,6 +27,7 @@ test('config is decoded from env', () => { lastWindowPosition: {x: 4, y: 8, width: 15, height: 16}, updaterEnabled: false, screenCapturePath: '/my/screenshot/path', + launcherEnabled: false, }); }); @@ -38,5 +40,6 @@ test('config is decoded from env with defaults', () => { lastWindowPosition: undefined, updaterEnabled: true, screenCapturePath: undefined, + launcherEnabled: true, }); }); diff --git a/src/utils/processConfig.js b/src/utils/processConfig.js index ccf10e268..d2ca3435c 100644 --- a/src/utils/processConfig.js +++ b/src/utils/processConfig.js @@ -13,6 +13,8 @@ export type ProcessConfig = {| lastWindowPosition: ?{x: number, y: number, width: number, height: number}, screenCapturePath: ?string, updaterEnabled: boolean, + // Controls whether to delegate to the launcher if present. + launcherEnabled: boolean, |}; let configObj = null; @@ -29,6 +31,8 @@ export default function config(): ProcessConfig { updaterEnabled: typeof json.updaterEnabled === 'boolean' ? json.updaterEnabled : true, screenCapturePath: json.screenCapturePath, + launcherEnabled: + typeof json.launcherEnabled === 'boolean' ? json.launcherEnabled : true, }; } diff --git a/static/index.js b/static/index.js index b867dba45..bfd5df5fb 100644 --- a/static/index.js +++ b/static/index.js @@ -43,6 +43,11 @@ const argv = yargs describe: 'Toggle the built-in update mechanism.', type: 'boolean', }) + .option('launcher', { + default: true, + describe: 'Toggle delegating to the update launcher on startup.', + type: 'boolean', + }) .version(global.__VERSION__) .help().argv;