(prompt: string)
| 33 | export const log = (...args: any[]) => console.error(args); |
| 34 | |
| 35 | function prompt(prompt: string): Promise<string> { |
| 36 | const rl = createInterface({ |
| 37 | input: process.stdin, |
| 38 | output: process.stderr |
| 39 | }); |
| 40 | |
| 41 | return new Promise((resolve, _) => { |
| 42 | rl.question(prompt, answer => { |
| 43 | rl.close(); |
| 44 | resolve(answer.trim()); |
| 45 | }); |
| 46 | }); |
| 47 | } |
| 48 | |
| 49 | export async function confirm(message: string) { |
| 50 | const response = await prompt(message); |