(name, command, args, extraEnv = {})
| 12 | } |
| 13 | |
| 14 | function start(name, command, args, extraEnv = {}) { |
| 15 | const child = spawn(command, args, { |
| 16 | cwd, |
| 17 | stdio: ['ignore', 'pipe', 'pipe'], |
| 18 | env: { |
| 19 | ...process.env, |
| 20 | ...extraEnv, |
| 21 | }, |
| 22 | }) |
| 23 | |
| 24 | forwardOutput(`[${name}] `, child.stdout, process.stdout) |
| 25 | forwardOutput(`[${name}] `, child.stderr, process.stderr) |
| 26 | |
| 27 | return child |
| 28 | } |
| 29 | |
| 30 | async function stop(child) { |
| 31 | if (!child || child.exitCode !== null) { |