mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-15 09:02:35 +00:00
14 lines
339 B
TypeScript
14 lines
339 B
TypeScript
import fs from "fs/promises"
|
|
import { tmpdir as osTmpdir } from "os"
|
|
import path from "path"
|
|
|
|
export const tmpdir = async () => {
|
|
const dir = await fs.mkdtemp(path.join(osTmpdir(), "opencode-core-test-"))
|
|
return {
|
|
path: dir,
|
|
async [Symbol.asyncDispose]() {
|
|
await fs.rm(dir, { recursive: true, force: true })
|
|
},
|
|
}
|
|
}
|