Skip to content

Commit

Permalink
chore: use for await
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 committed Feb 23, 2020
1 parent f7ba755 commit f8a52ec
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/webpack-cli/lib/utils/cli-executer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ async function prompter() {
});

// Create promise chain to force synchronous prompt of question
await questions.reduce((prev, curr) => {
return prev.then(() => curr.run().then((flagArgs) => {
args.push(...flagArgs);
}));
}, Promise.resolve(null));
for await (question of questions) {
const flagArgs = await question.run();
args.push(...flagArgs);
}

return [...args, ...boolArgs];
}
Expand Down

0 comments on commit f8a52ec

Please sign in to comment.