()
| 72 | let timer: ReturnType<typeof setTimeout> | undefined |
| 73 | |
| 74 | const abort = () => { |
| 75 | if (closed) return |
| 76 | if (proc.exitCode !== null || proc.signalCode !== null) return |
| 77 | closed = true |
| 78 | |
| 79 | proc.kill(opts.kill ?? "SIGTERM") |
| 80 | |
| 81 | const ms = opts.timeout ?? 5_000 |
| 82 | if (ms <= 0) return |
| 83 | timer = setTimeout(() => proc.kill("SIGKILL"), ms) |
| 84 | } |
| 85 | |
| 86 | const exited = new Promise<number>((resolve, reject) => { |
| 87 | const done = () => { |