From 3b53aff55c4bad67145c4d8843a0e0980bbe9608 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 20 Mar 2019 05:28:01 -0700 Subject: [PATCH] Add --file option Summary: Positional arguments with yargs are a mess, so I'm adding a `--file` instead. This can then be used to pass parameters on through the launcher. Reviewed By: danielbuechele Differential Revision: D14525320 fbshipit-source-id: f04ebed85b6eb9e3c82e76736695d41e7bafb301 --- static/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/index.js b/static/index.js index d424932d3..c79b32470 100644 --- a/static/index.js +++ b/static/index.js @@ -38,6 +38,10 @@ if (process.platform === 'darwin') { const argv = yargs .usage('$0 [args]') + .option('file', { + describe: 'Define a file to open on startup.', + type: 'string', + }) .option('updater', { default: true, describe: 'Toggle the built-in update mechanism.', @@ -54,7 +58,8 @@ const argv = yargs type: 'string', }) .version(global.__VERSION__) - .help().argv; + .help() + .parse(process.argv.slice(1)); let {config, configPath, flipperDir} = setup(argv); @@ -76,7 +81,7 @@ let win; let appReady = false; let pluginsCompiled = false; let deeplinkURL = null; -let filePath = null; +let filePath = argv.file; // tracking setInterval(() => {