| 100 | } |
| 101 | |
| 102 | function writePromptFrame( |
| 103 | output: NodeJS.WriteStream, |
| 104 | lines: readonly string[], |
| 105 | previousLineCount: number, |
| 106 | ): number { |
| 107 | if (previousLineCount > 0) { |
| 108 | moveCursor(output, 0, -(previousLineCount - 1)); |
| 109 | } |
| 110 | |
| 111 | for (let i = 0; i < lines.length; i++) { |
| 112 | clearLine(output, 0); |
| 113 | cursorTo(output, 0); |
| 114 | output.write(lines[i] ?? ''); |
| 115 | if (i < lines.length - 1) { |
| 116 | output.write('\n'); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | return lines.length; |
| 121 | } |
| 122 | |
| 123 | export async function promptForInstallChoice( |
| 124 | options: InstallPromptOptions, |