* Check if a process is still running
(pid: number)
| 631 | * Check if a process is still running |
| 632 | */ |
| 633 | private isProcessAlive(pid: number): boolean { |
| 634 | try { |
| 635 | process.kill(pid, 0); |
| 636 | return true; |
| 637 | } catch (err) { |
| 638 | // EPERM: it exists but is not ours to signal (another user's, or elevated on Windows). |
| 639 | return (err as NodeJS.ErrnoException).code === 'EPERM'; |
| 640 | } |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | /** |