* Prompt for yes/no input. * * @param prompt - The prompt text to display * @param defaultValue - Default value if empty input (default: false) * @returns true for yes, false for no
(prompt: string, defaultValue = false)
| 137 | * @returns true for yes, false for no |
| 138 | */ |
| 139 | async promptForYesNo(prompt: string, defaultValue = false): Promise<boolean> { |
| 140 | const answer = await this.promptForInput(prompt) |
| 141 | const normalized = answer.trim().toLowerCase() |
| 142 | if (normalized === "" && defaultValue !== undefined) { |
| 143 | return defaultValue |
| 144 | } |
| 145 | return normalized === "y" || normalized === "yes" |
| 146 | } |
| 147 | |
| 148 | /** |
| 149 | * Prompt for input with a timeout. |
no test coverage detected