Skip to content

Commit a468250

Browse files
committed
feat: setting runConcurrently to true enables concurrency
ref pnpm/pnpm#1578
1 parent a4330d9 commit a468250

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ jump in if you'd like to, or even ask us questions if something isn't clear.
4242

4343
* `opts.stdio` - the [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio)
4444
passed to the child process. `[0, 1, 2]` by default.
45+
* `opts.runConcurrently` - *Boolean* - `false` by default. If `true`, lifecycle scripts may run concurrently.
4546

4647
##### Example
4748

index.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,14 @@ function dequeue () {
224224
}
225225

226226
function runCmd (note, cmd, pkg, env, stage, wd, opts, cb) {
227-
if (running) {
228-
queue.push([note, cmd, pkg, env, stage, wd, opts, cb])
229-
return
230-
}
227+
if (opts.runConcurrently !== true) {
228+
if (running) {
229+
queue.push([note, cmd, pkg, env, stage, wd, opts, cb])
230+
return
231+
}
231232

232-
running = true
233+
running = true
234+
}
233235
opts.log.pause()
234236
var unsafe = opts.unsafePerm
235237
var user = unsafe ? null : opts.user

0 commit comments

Comments
 (0)