Add a --stream option to the run command#608
Conversation
Emit output from child processes immediately. - Each line is prefixed with the name of the originating package. - Output from stdout goes to stdout, and stderr goes to stderr. ```sh $ lerna run watch --stream ``` This closes lerna#446.
Also simplify partial line handling.
|
That's great! This will be very helpful. |
|
|
||
| static spawnStreaming(command, args, opts, prefix, callback) { | ||
| opts = Object.assign({}, opts, { | ||
| stdio: ["ignore", "pipe", "pipe"], |
There was a problem hiding this comment.
Hi. Sorry to bother you on such an old PR but I am curious about the motivation for ignoring stdin? I understand that it could not really make sense in some case (that I don't have in mind - I am not an stdin/out professional), but I am facing an issue and switching ignore with pipe or inherit seems to change nothing in most case but could help me with my issue.
There was a problem hiding this comment.
I think the biggest problem with "inherit" is in concurrent execution: which process "gets" to have stdin, should it be necessary? Imagine 8 concurrent npm executions demanding a one-time password, for example.
I am sympathetic to this, but I think we would need an option, like --inherit-stdin, to explicitly enable this in both lerna exec and lerna run. Open questions:
- Should
--inherit-stdinimply--stream? - Should
--inherit-stdinbe allowed if--parallelis enabled?
There are two options, as I see it, to avoid the interleaved/conflicting stdin problem:
--inherit-stdinimplicitly restricts concurrency to1- Recommend
--concurrency 1in docs, warn loudly whenthis.concurrency !== 1
|
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Emit output from child processes immediately.
This closes #446.