(pid?: number)
| 54 | } |
| 55 | } |
| 56 | public static kill(pid?: number): void { |
| 57 | try { |
| 58 | if (!pid) { |
| 59 | return; |
| 60 | } |
| 61 | if (process.platform === 'win32') { |
| 62 | // Windows doesn't support SIGTERM, so execute taskkill to kill the process |
| 63 | execSync(`taskkill /pid ${pid} /T /F`); |
| 64 | } else { |
| 65 | process.kill(pid); |
| 66 | } |
| 67 | } catch { |
| 68 | // Ignore. |
| 69 | } |
| 70 | } |
| 71 | public dispose() { |
| 72 | this.processesToKill.forEach((p) => { |
| 73 | try { |