kentcdodds / kentcdodds/nps-utils
concurrent + series not working together
- Dominant language
- JavaScript
- Stars
- 98
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
`npsUtils.concurrent.nps('task1', 'task2', 'task3')` works fine, as does the equivalent `npsUtils.concurrent('nps task1', 'nps task2', 'nps task3')`
however when you put a `series` inside of `concurrent`, such as the following:
```js
npsUtils.concurrent(npsUtils.series('task a', 'task b'), 'nps task 1', 'nps task 2'));
```
it fails with a weird key/range output, and the only way to fix is to take the series part out and put it into its own task and replace it with the name of the task:
```sh
λ ~/Projects/lad/template/ master* yarn start pretest
yarn run v1.3.2
$ nps pretest
nps is executing `pretest` : node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=test WEB_TIMEOUT_MS=10000 API_TIMEOUT_MS=10000 MONGO_NAME=lad_test REDIS_URL=redis://localhost:6379/lad_test I18N_SYNC_FILES=false I18N_AUTH_RELOAD=false I18N_UPDATE_FILES=false node node_modules/concurrently/src/main.js --kill-others-on-fail --prefix-colors "bgBlue.bold,bgMagenta.bold,bgGreen.bold,bgBlack.bold,bgCyan.bold,bgRed.bold,bgWhite.bold,bgYellow.bold,bgBlue.bold,bgMagenta.bold,bgGreen.bold,bgBlack.bold,bgCyan.bold,bgRed.bold,bgWhite.bold,bgYellow.bold,bgBlue.bold,bgMagenta.bold,bgGreen.bold,bgBlack.bold,bgCyan.bold" --prefix "[{name}]" --names "0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20" n p s ' ' b u i l d ' ' '&' '&' ' ' n p s ' ' l i n t
[0] /bin/sh: n: command not found
[1] /bin/sh: p: command not found
[2] /bin/sh: s: command not found
[4] /bin/sh: b: command not found
[5] /bin/sh: u: command not found
[6] /bin/sh: i: command not found
[7] /bin/sh: l: command not found
[8] /bin/sh: d: command not found
[10] /bin/sh: -c: line 0: syntax error near unexpected token `&'
[10] /bin/sh: -c: line 0: `&'
[11] /bin/sh: -c: line 0: syntax error near unexpected token `&'
[11] /bin/sh: -c: line 0: `&'
[13] /bin/sh: n: command not found
[14] /bin/sh: p: command not found
[15] /bin/sh: s: command not found
[17] /bin/sh: l: command not found
[18] /bin/sh: i: command not found
[19] /bin/sh: n: command not found
[20] /bin/sh: t: command not found
[16] exited with code 0
[12] exited with code 0
[9] exited with code 0
[3] exited with code 0
[20] t exited with code 127
--> Sending SIGTERM to other processes..
[19] n exited with code 127
[18] i exited with code 127
[17] l exited with code 127
[15] s exited with code 127
[14] p exited with code 127
[13] n exited with code 127
[11] & exited with code 2
[10] & exited with code 2
[8] d exited with code 127
[7] l exited with code 127
[6] i exited with code 127
[5] u exited with code 127
[4] b exited with code 127
[2] s exited with code 127
[1] p exited with code 127
[0] n exited with code 127
```
Contributor guide
Research direction
Start by reproducing the nested npsUtils.concurrent and npsUtils.series example from the issue, then compare it with the working direct concurrent calls. Trace how the nested series is passed into concurrent; done means its commands are kept together and executed in order instead of being split into individual characters or shell operators.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100