Skip to content

Commit b90575b

Browse files
committed
Fix: it threw for --race even if --parallel exists (fixes #88)
1 parent acb1582 commit b90575b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

bin/npm-run-all/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ module.exports = function npmRunAll(args, stdout, stderr) {
4242
stderr,
4343
stdin,
4444
parallel: group.parallel,
45-
maxParallel: argv.maxParallel,
45+
maxParallel: group.parallel ? argv.maxParallel : 1,
4646
continueOnError: argv.continueOnError,
4747
printLabel: argv.printLabel,
4848
printName: argv.printName,
4949
config: argv.config,
5050
packageConfig: argv.packageConfig,
5151
silent: argv.silent,
5252
arguments: argv.rest,
53-
race: argv.race,
53+
race: group.parallel && argv.race,
5454
npmPath: argv.npmPath,
5555
}
5656
))

test/mixed.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,13 @@ describe("[mixed] npm-run-all", () => {
5353
result() === "cbcbddee")
5454
})
5555
)
56+
57+
it("should not throw errors for --race and --max-parallel options if --parallel exists:", () =>
58+
runAll([
59+
"test-task:append a",
60+
"-p", "test-task:append b", "test-task:append c",
61+
"-s", "test-task:append d", "test-task:append e",
62+
"-r",
63+
])
64+
)
5665
})

0 commit comments

Comments
 (0)