(
cmd: string,
args: string[],
options: Options = {},
)
| 60 | } |
| 61 | |
| 62 | private runInProcess( |
| 63 | cmd: string, |
| 64 | args: string[], |
| 65 | options: Options = {}, |
| 66 | ): void { |
| 67 | if (options.msg) { |
| 68 | info.lowLevel(options.msg); |
| 69 | } |
| 70 | const str = utils.convertCLIArgsToReadableCommand([cmd, ...args]); |
| 71 | this.nProc++; |
| 72 | const proc = cp.spawn(cmd, args); |
| 73 | proc.on('exit', code => { |
| 74 | info.lowLevel(`done: ${str}`); |
| 75 | if (code !== 0) { |
| 76 | info.error(`fail: ${str}`); |
| 77 | } |
| 78 | this.freeProcess(); |
| 79 | }); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | export default ProcessManager; |
no test coverage detected