Skip to content

Commit

Permalink
Set up OutputWriter earlier to fix --timings
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavohenke committed Dec 24, 2021
1 parent 850d2dc commit 3528873
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/concurrently.js
Expand Up @@ -64,11 +64,6 @@ module.exports = (commands, options) => {
);
commands = handleResult.commands;

const commandsLeft = commands.slice();
const maxProcesses = Math.max(1, Number(options.maxProcesses) || commandsLeft.length);
for (let i = 0; i < maxProcesses; i++) {
maybeRunMore(commandsLeft);
}

if (options.logger) {
const outputWriter = new OutputWriter({
Expand All @@ -79,6 +74,12 @@ module.exports = (commands, options) => {
options.logger.observable.subscribe(({command, text}) => outputWriter.write(command, text));
}

const commandsLeft = commands.slice();
const maxProcesses = Math.max(1, Number(options.maxProcesses) || commandsLeft.length);
for (let i = 0; i < maxProcesses; i++) {
maybeRunMore(commandsLeft);
}

return new CompletionListener({
successCondition: options.successCondition,
})
Expand Down

0 comments on commit 3528873

Please sign in to comment.