Refactor npm config handling (#24565)

This commit is contained in:
Dax 2026-04-26 23:54:59 -04:00 committed by GitHub
commit a9b62d67df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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 })
},
}
}