Skip to content

Commit

Permalink
Makes the execution synchronous
Browse files Browse the repository at this point in the history
  • Loading branch information
Maël Nison committed Aug 13, 2018
1 parent ab92bcf commit 54f4c24
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/cli/commands/workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,15 @@ export async function runScript(config: Config, reporter: Reporter, flags: Objec

try {
const [_, ...rest] = flags.originalArgs || [];
const childProcesses = [];

for (const workspaceName of Object.keys(workspaces)) {
const {loc} = workspaces[workspaceName];
childProcesses.push(
child.spawn(NODE_BIN_PATH, [YARN_BIN_PATH, ...rest], {
stdio: 'inherit',
cwd: loc,
}),
);
}

await Promise.all(childProcesses);
await child.spawn(NODE_BIN_PATH, [YARN_BIN_PATH, ...rest], {
stdio: 'inherit',
cwd: loc,
});
}
} catch (err) {
throw err;
}
Expand Down

0 comments on commit 54f4c24

Please sign in to comment.