Refactor npm config handling (#24565)

This commit is contained in:
Dax
2026-04-26 23:54:59 -04:00
committed by GitHub
parent 3525e61906
commit a9b62d67df
13 changed files with 207 additions and 293 deletions

View File

@@ -0,0 +1,13 @@
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 })
},
}
}