From 2665ca84162bcc284a8af9feeae0195801e7b1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dandelion=20Man=C3=A9?= Date: Wed, 17 Jun 2020 19:48:00 -0700 Subject: [PATCH] Change `yarn start2` argument structure Now you pass `--instance PATH` rather than `--instance=PATH` which is agreed to be much much better. (It tab completes.) Test plan: Do the obvious thing. :) --- config/webpack.config.web2.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/config/webpack.config.web2.js b/config/webpack.config.web2.js index 436b117..30218e0 100644 --- a/config/webpack.config.web2.js +++ b/config/webpack.config.web2.js @@ -42,14 +42,13 @@ async function makeConfig( before: (app /*: ExpressApp */) => { let developmentInstancePath /*: ?string */ = process.env["SOURCECRED_DEV_INSTANCE"]; - const lastArg = process.argv[process.argv.length - 1]; - if (lastArg.startsWith("--instance")) { - const pieces = lastArg.split("="); - developmentInstancePath = pieces[1]; + const argv = process.argv; + if (argv[argv.length - 2] === "--instance") { + developmentInstancePath = argv[argv.length - 1]; } if (developmentInstancePath == null) { throw new Error( - "Please provide a SourceCred cli2 instance, via $SOURCECRED_DEV_INSTANCE, or --instance=PATH" + "Please provide a SourceCred cli2 instance, via $SOURCECRED_DEV_INSTANCE, or --instance PATH" ); } const configPath = path.join(