Skip to content

Commit

Permalink
fix: expose timed prompt in command class
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale committed Mar 11, 2022
1 parent 71ee6ac commit 3b056c6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,16 @@ export abstract class SfCommand<T> extends Command {
return this.prompter.prompt(questions, initialAnswers);
}

/**
* Prompt user for information with a timeout (in milliseconds). See https://www.npmjs.com/package/inquirer for more.
*/
public async timedPrompt<R = Prompter.Answers>(
questions: Prompter.Questions<R>,
ms = 10_000,
initialAnswers?: Partial<R>
): Promise<R> {
return this.prompter.timedPrompt(questions, 10_000, initialAnswers);
}
public async _run<R>(): Promise<R | undefined> {
if (this.statics.requiresProject) {
this.project = await this.assignProject();
Expand Down

0 comments on commit 3b056c6

Please sign in to comment.