Skip to content

Commit

Permalink
fix: Do not do Promise.all on already resolved Promises
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Nov 9, 2019
1 parent d6fe235 commit 77c11a8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/spire/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ async function spire({
const context = { argv, cli, cwd, env, logger };
const state = createState();
const core = createCore(context, state);
const running = [];
// Resolve and flattern config
let config;
try {
Expand Down Expand Up @@ -52,9 +51,7 @@ async function spire({
// Call the plugin command
try {
logger.debug('Running %s.run', plugin.name);
const promise = plugin.run({ options, ...context });
running.push(promise);
await promise;
await plugin.run({ options, ...context });
} catch (error) {
errors.push(error);
}
Expand All @@ -75,8 +72,6 @@ async function spire({
return 1;
}
}
// Wait for commands to finish
await Promise.all(running);
// Run teardown hooks
for (const plugin of config.plugins) {
if (plugin.teardown) {
Expand Down

0 comments on commit 77c11a8

Please sign in to comment.