(
message: string,
choices: { name: string; value: string; checked?: boolean }[],
noTTYResponse: string[] | null,
)
| 53 | } |
| 54 | |
| 55 | export async function askChoices( |
| 56 | message: string, |
| 57 | choices: { name: string; value: string; checked?: boolean }[], |
| 58 | noTTYResponse: string[] | null, |
| 59 | ): Promise<string[] | null> { |
| 60 | if (!isTTY()) { |
| 61 | return noTTYResponse; |
| 62 | } |
| 63 | |
| 64 | const { checkbox } = await import('@inquirer/prompts'); |
| 65 | const answers = await checkbox({ |
| 66 | message, |
| 67 | choices, |
| 68 | theme: { |
| 69 | prefix: '', |
| 70 | }, |
| 71 | }); |
| 72 | |
| 73 | return answers; |
| 74 | } |
no test coverage detected