()
| 46 | } |
| 47 | |
| 48 | async function readLock(): Promise<ComputerUseLock | undefined> { |
| 49 | try { |
| 50 | const raw = await readFile(getLockPath(), 'utf8') |
| 51 | const parsed: unknown = jsonParse(raw) |
| 52 | return isComputerUseLock(parsed) ? parsed : undefined |
| 53 | } catch { |
| 54 | return undefined |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Check whether a process is still running (signal 0 probe). |
no test coverage detected