( plugin: QuickAdd, params: CliData, command: string, )
| 496 | } |
| 497 | |
| 498 | async function runChoiceHandler( |
| 499 | plugin: QuickAdd, |
| 500 | params: CliData, |
| 501 | command: string, |
| 502 | ): Promise<string> { |
| 503 | let choice: IChoice; |
| 504 | try { |
| 505 | choice = resolveChoiceFromParams(plugin, params); |
| 506 | } catch (error) { |
| 507 | return serialize({ |
| 508 | ok: false, |
| 509 | command, |
| 510 | error: error instanceof Error ? error.message : String(error), |
| 511 | }); |
| 512 | } |
| 513 | |
| 514 | return runResolvedChoice( |
| 515 | plugin, |
| 516 | params, |
| 517 | command, |
| 518 | choice, |
| 519 | RESERVED_RUN_PARAMS, |
| 520 | // Opt-in (`verify`) so existing scripts keying off the legacy envelope |
| 521 | // keep their behavior; run-template made the outcome path the default |
| 522 | // from the start, quickadd:run could not. |
| 523 | /* useOutcome */ isTruthy(params.verify), |
| 524 | ); |
| 525 | } |
| 526 | |
| 527 | async function runTemplateHandler( |
| 528 | plugin: QuickAdd, |
no test coverage detected