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. :)
This commit is contained in:
Dandelion Mané 2020-06-17 19:48:00 -07:00
parent 7ec34edd0d
commit 2665ca8416
1 changed files with 4 additions and 5 deletions

View File

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