diff --git a/prompter.ts b/prompter.ts index d9249061..d54c1a1c 100644 --- a/prompter.ts +++ b/prompter.ts @@ -14,8 +14,10 @@ export class Prompter implements IPrompter { } public async get(schemas: IPromptSchema[]): Promise { - return new Promise((resolve, reject) => { - try { + let promptResult: any; + + try { + promptResult = await new Promise((resolve, reject) => { this.muteStdout(); if (!helpers.isInteractive()) { @@ -40,10 +42,12 @@ export class Prompter implements IPrompter { } }); } - } finally { - this.unmuteStdout(); - } - }); + }); + } finally { + this.unmuteStdout(); + } + + return promptResult; } public async getPassword(prompt: string, options?: IAllowEmpty): Promise {