Skip to content

Commit

Permalink
commands: expose count, repetitions, register to .run
Browse files Browse the repository at this point in the history
  • Loading branch information
71 committed Sep 25, 2021
1 parent f7d2111 commit 03fe2cc
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
15 changes: 9 additions & 6 deletions src/commands/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/commands/load-all.build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function determineFunctionExpression(f: Builder.ParsedFunction) {
case "register":
takeArgument = true;

const match = /^RegisterOr<"(\w+)"(?:, (.+))>$/.exec(type);
const match = /^RegisterOr<"(\w+)"(?:, (.+))?>$/.exec(type);

assert(match !== null);

Expand Down
2 changes: 1 addition & 1 deletion src/commands/load-all.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion src/commands/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ export async function run(
_: Context,
inputOr: InputOr<string | readonly string[]>,

count: number,
repetitions: number,
register: RegisterOr<"null">,

commands?: Argument<command.Any[]>,
) {
if (Array.isArray(commands)) {
Expand Down Expand Up @@ -166,7 +170,7 @@ export async function run(
return new InputError(`expected code to be a string or an array, but it was ${code}`);
}

return _.run(() => apiRun(code as string));
return _.run(() => apiRun(code as string, { count, repetitions, register }));
}

/**
Expand Down

0 comments on commit 03fe2cc

Please sign in to comment.