(proc: ChildProcess)
| 3 | // Duplicated from `packages/opencode/src/util/process.ts` because the SDK cannot |
| 4 | // import `opencode` without creating a cycle (`opencode` depends on `@opencode-ai/sdk`). |
| 5 | export function stop(proc: ChildProcess) { |
| 6 | if (proc.exitCode !== null || proc.signalCode !== null) return |
| 7 | if (process.platform === "win32" && proc.pid) { |
| 8 | const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true }) |
| 9 | if (!out.error && out.status === 0) return |
| 10 | } |
| 11 | proc.kill() |
| 12 | } |
| 13 | |
| 14 | export function bindAbort(proc: ChildProcess, signal?: AbortSignal, onAbort?: () => void) { |
| 15 | if (!signal) return () => {} |
no outgoing calls
no test coverage detected