(options: {
message: string;
})
| 46 | * Like promptText but confirms with y/N before proceeding. |
| 47 | */ |
| 48 | export async function promptConfirm(options: { |
| 49 | message: string; |
| 50 | }): Promise<boolean | undefined> { |
| 51 | if (!isInteractive()) return undefined; |
| 52 | |
| 53 | const { message } = options; |
| 54 | const inquirer = await import('@clack/prompts'); |
| 55 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 56 | const val = await (inquirer as any).confirm({ message }); |
| 57 | |
| 58 | if (typeof val === 'symbol') return undefined; |
| 59 | return val as boolean; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Fail fast with a user-friendly error when a required option is missing |
no test coverage detected