Skip to content

Commit

Permalink
fix(wb): retry command
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Nov 9, 2023
1 parent 728c414 commit 1a274dd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/wb/src/commands/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,18 @@ const argumentsBuilder = {
command: {
description: 'A command to retry',
type: 'string',
demand: true,
},
args: {
description: 'Arguments for the command',
type: 'array',
default: [],
},
} as const;

export const retryCommand: CommandModule<
unknown,
InferredOptionTypes<typeof builder & typeof sharedOptionsBuilder & typeof argumentsBuilder>
> = {
command: 'retry <command> [args...]',
command: 'retry [command] [args...]',
describe: 'Retry the given command until it succeeds',
builder,
async handler(argv) {
Expand All @@ -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) {
Expand Down

0 comments on commit 1a274dd

Please sign in to comment.