(signal: NodeJS.Signals)
| 105 | // die too; fall back to a plain proc.kill if the group signal can't be sent |
| 106 | // (already dead, or Windows where there's no group). |
| 107 | const killTree = (signal: NodeJS.Signals): void => { |
| 108 | const pid = proc.pid; |
| 109 | if (pid != null && process.platform !== 'win32') { |
| 110 | try { process.kill(-pid, signal); return; } catch { /* fall through */ } |
| 111 | } |
| 112 | try { proc.kill(signal); } catch { /* already gone */ } |
| 113 | }; |
| 114 | |
| 115 | const termTimer = setTimeout(() => { |
| 116 | timedOut = true; |