Set up --no-launcher flag

Summary: For future use to disable launcher loops.

Reviewed By: jknoxville

Differential Revision: D13979653

fbshipit-source-id: db56f7d71d7a4d1322cb36622313dbad4307396d
This commit is contained in:
Pascal Hartig
2019-02-14 02:24:35 -08:00
committed by Facebook Github Bot
parent 39cb25ade9
commit 2b9e3c54c6
3 changed files with 12 additions and 0 deletions

View File

@@ -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,
});
});

View File

@@ -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,
};
}

View File

@@ -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;