Refactor npm config handling (#24565)
This commit is contained in:
parent
3525e61906
commit
a9b62d67df
13 changed files with 207 additions and 293 deletions
13
packages/core/test/fixture/tmpdir.ts
Normal file
13
packages/core/test/fixture/tmpdir.ts
Normal 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 })
|
||||
},
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue