(child: ResultPromise)
| 32 | * each line with the magenta [next] tag. |
| 33 | */ |
| 34 | export function pipeChildOutput(child: ResultPromise): void { |
| 35 | if (child.stdout) { |
| 36 | const rl = createInterface({ input: child.stdout }); |
| 37 | rl.on('line', (line) => { |
| 38 | process.stdout.write(`${NEXT_PREFIX} ${line}\n`); |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | if (child.stderr) { |
| 43 | const rl = createInterface({ input: child.stderr }); |
| 44 | rl.on('line', (line) => { |
| 45 | process.stderr.write(`${NEXT_PREFIX} ${line}\n`); |
| 46 | }); |
| 47 | } |
| 48 | } |