(lockPath: string)
| 58 | } |
| 59 | |
| 60 | function readLockInfo(lockPath: string): DaemonLockInfo | null { |
| 61 | if (!fs.existsSync(lockPath)) return null; |
| 62 | try { |
| 63 | const parsed = JSON.parse(fs.readFileSync(lockPath, 'utf8')) as DaemonLockInfo; |
| 64 | if (!Number.isInteger(parsed.pid) || parsed.pid <= 0) return null; |
| 65 | return parsed; |
| 66 | } catch { |
| 67 | return null; |
| 68 | } |
| 69 | } |
| 70 | |
| 71 | export function acquireDaemonLock( |
| 72 | baseDir: string, |
no test coverage detected
searching dependent graphs…