* Check if a process is still running
(pid: number)
| 655 | * Check if a process is still running |
| 656 | */ |
| 657 | private isProcessAlive(pid: number): boolean { |
| 658 | try { |
| 659 | process.kill(pid, 0); |
| 660 | return true; |
| 661 | } catch (err) { |
| 662 | // EPERM: it exists but is not ours to signal (another user's, or elevated on Windows). |
| 663 | return (err as NodeJS.ErrnoException).code === 'EPERM'; |
| 664 | } |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | /** |