(
type: ItemType,
options: ShowExecuteOptions,
root: ResolvedOpenSpecRoot
)
| 72 | } |
| 73 | |
| 74 | private async runInteractiveByType( |
| 75 | type: ItemType, |
| 76 | options: ShowExecuteOptions, |
| 77 | root: ResolvedOpenSpecRoot |
| 78 | ): Promise<void> { |
| 79 | const { select } = await import('@inquirer/prompts'); |
| 80 | if (type === 'change') { |
| 81 | const changes = await getActiveChangeIds(root.path); |
| 82 | if (changes.length === 0) { |
| 83 | console.error('No changes found.'); |
| 84 | process.exitCode = 1; |
| 85 | return; |
| 86 | } |
| 87 | const picked = await select<string>({ message: 'Pick a change', choices: changes.map(id => ({ name: id, value: id })) }); |
| 88 | const cmd = new ChangeCommand(root.path); |
| 89 | await cmd.show(picked, this.delegateOptions(root, options) as any); |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | const specs = await getSpecIds(root.path); |
| 94 | if (specs.length === 0) { |
| 95 | console.error('No specs found.'); |
| 96 | process.exitCode = 1; |
| 97 | return; |
| 98 | } |
| 99 | const picked = await select<string>({ message: 'Pick a spec', choices: specs.map(id => ({ name: id, value: id })) }); |
| 100 | const cmd = new SpecCommand(root.path); |
| 101 | await cmd.show(picked, this.delegateOptions(root, options) as any); |
| 102 | } |
| 103 | |
| 104 | private async showDirect( |
| 105 | itemName: string, |
no test coverage detected