()
| 3 | import path from "path" |
| 4 | |
| 5 | export const tmpdir = async () => { |
| 6 | const dir = await fs.realpath(await fs.mkdtemp(path.join(osTmpdir(), "opencode-core-test-"))) |
| 7 | return { |
| 8 | path: dir, |
| 9 | async [Symbol.asyncDispose]() { |
| 10 | await remove(dir) |
| 11 | }, |
| 12 | } |
| 13 | } |
| 14 | |
| 15 | async function remove(dir: string, retries = 30): Promise<void> { |
| 16 | try { |
no outgoing calls