Use yargs for non-headless Flipper args parsing
Summary: This seems like a better approach than ad-hoc lookup in `electron.remove.argv`. Left a note to a task to provide a better interface to this. I also need this in order to ensure we're starting Flipper through the launcher which needs to happen before we start the Electron runtime. Reviewed By: jknoxville Differential Revision: D13881355 fbshipit-source-id: 69c70d71035a47084f789ddb4dc969b45ba4648b
This commit is contained in:
committed by
Facebook Github Bot
parent
3b75fb092b
commit
74a726aaf9
@@ -17,6 +17,7 @@ const compilePlugins = require('./compilePlugins.js');
|
||||
const os = require('os');
|
||||
const setup = require('./setup');
|
||||
const expandTilde = require('expand-tilde');
|
||||
const yargs = require('yargs');
|
||||
|
||||
// disable electron security warnings: https://github.com/electron/electron/blob/master/docs/tutorial/security.md#security-native-capabilities-and-your-responsibility
|
||||
process.env.ELECTRON_DISABLE_SECURITY_WARNINGS = true;
|
||||
@@ -36,7 +37,17 @@ if (process.platform === 'darwin') {
|
||||
}
|
||||
}
|
||||
|
||||
let {config, configPath, flipperDir} = setup();
|
||||
const argv = yargs
|
||||
.usage('$0 [args]')
|
||||
.option('updater', {
|
||||
default: true,
|
||||
describe: 'Toggle the built-in update mechanism.',
|
||||
type: 'boolean',
|
||||
})
|
||||
.version(global.__VERSION__)
|
||||
.help().argv;
|
||||
|
||||
let {config, configPath, flipperDir} = setup(argv);
|
||||
|
||||
const pluginPaths = config.pluginPaths
|
||||
.concat(
|
||||
|
||||
Reference in New Issue
Block a user