From 1a274ddad9c2c2877a610c9cbc8ac31fb5461d55 Mon Sep 17 00:00:00 2001 From: "Sakamoto, Kazunori" Date: Thu, 9 Nov 2023 14:20:53 +0900 Subject: [PATCH] fix(wb): retry command --- packages/wb/src/commands/retry.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/wb/src/commands/retry.ts b/packages/wb/src/commands/retry.ts index 20f30e61..1cdd0402 100644 --- a/packages/wb/src/commands/retry.ts +++ b/packages/wb/src/commands/retry.ts @@ -18,12 +18,10 @@ const argumentsBuilder = { command: { description: 'A command to retry', type: 'string', - demand: true, }, args: { description: 'Arguments for the command', type: 'array', - default: [], }, } as const; @@ -31,7 +29,7 @@ export const retryCommand: CommandModule< unknown, InferredOptionTypes > = { - command: 'retry [args...]', + command: 'retry [command] [args...]', describe: 'Retry the given command until it succeeds', builder, async handler(argv) { @@ -41,7 +39,7 @@ export const retryCommand: CommandModule< process.exit(1); } - const cmdAndArgs = [argv.command, ...argv.args]; + const cmdAndArgs = [argv.command, ...(argv.args ?? []), ...argv._.slice(1)].filter(Boolean); let lastStatus = 0; for (let i = 0; i < argv.retry; i++) { if (i > 0) {