(stateDir: string)
| 86 | } |
| 87 | |
| 88 | function hasLiveDaemon(stateDir: string): boolean { |
| 89 | const dirInfo = readDaemonInfo(path.join(stateDir, 'daemon.json')); |
| 90 | const pid = readPositivePid(dirInfo?.pid); |
| 91 | return pid !== null && isAgentDeviceDaemonProcess(pid, dirInfo?.processStartTime); |
| 92 | } |
| 93 | |
| 94 | function readPositivePid(pid: number | undefined): number | null { |
| 95 | if (typeof pid !== 'number') return null; |
no test coverage detected