diff --git a/src/sfCommand.ts b/src/sfCommand.ts index 8f8d2648..828f89e5 100644 --- a/src/sfCommand.ts +++ b/src/sfCommand.ts @@ -167,16 +167,20 @@ export abstract class SfCommand extends Command { * Simplified prompt for single-question confirmation. Times out and throws after 10s * * @param message text to display. Do not include a question mark. + * @param ms milliseconds to wait for user input. Defaults to 10s. * @return true if the user confirms, false if they do not. */ - public async confirm(message: string): Promise { - const { confirmed } = await this.prompt<{ confirmed: boolean }>([ - { - name: 'confirmed', - message, - type: 'confirm', - }, - ]); + public async confirm(message: string, ms = 10000): Promise { + const { confirmed } = await this.timedPrompt<{ confirmed: boolean }>( + [ + { + name: 'confirmed', + message, + type: 'confirm', + }, + ], + ms + ); return confirmed; }