From 5d8c64df831531feb685c498b8ecf3419a976865 Mon Sep 17 00:00:00 2001 From: Timo Hocker Date: Thu, 7 May 2020 13:25:12 +0200 Subject: [PATCH] immediately ask for correction --- lib/InteractiveOptions.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/InteractiveOptions.ts b/lib/InteractiveOptions.ts index 3c08ace..1e91e4a 100644 --- a/lib/InteractiveOptions.ts +++ b/lib/InteractiveOptions.ts @@ -236,14 +236,13 @@ export class InteractiveOptions extends Persistent { process.exit (0); } } - let invalid = false; for (const opt of this.options) { - // eslint-disable-next-line no-await-in-loop - await this.prompt (opt); - if (opt.filled === false) - invalid = true; + while (!opt.filled) { + // eslint-disable-next-line no-await-in-loop + await this.prompt (opt); + if (!opt.filled) + console.log ('input was invalid'); + } } - if (invalid) - await this.get_interactive_options (); } }