(message: string, yes?: boolean)
| 10 | } |
| 11 | |
| 12 | const ensureConfirmed = async (message: string, yes?: boolean): Promise<boolean> => { |
| 13 | if (yes) { |
| 14 | return true |
| 15 | } |
| 16 | |
| 17 | if (!process.stdin.isTTY) { |
| 18 | throw new Error('Interactive confirmation is unavailable. Re-run with --yes.') |
| 19 | } |
| 20 | |
| 21 | const answer = await confirm({ message, initialValue: false }) |
| 22 | if (isCancel(answer)) { |
| 23 | cancel('Operation cancelled') |
| 24 | return false |
| 25 | } |
| 26 | |
| 27 | return answer |
| 28 | } |
| 29 | |
| 30 | const runWithSpinner = async ( |
| 31 | loadingText: string, |
no outgoing calls
no test coverage detected