MCPcopy
hub / github.com/anomalyco/opencode / withTmp

Function withTmp

packages/core/test/location-filesystem.test.ts:23–27  ·  view source on GitHub ↗
(f: (directory: string) => Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

21 )
22
23const withTmp = <A, E, R>(f: (directory: string) => Effect.Effect<A, E, R>) =>
24 Effect.acquireRelease(
25 Effect.promise(() => tmpdir()),
26 (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
27 ).pipe(Effect.flatMap((tmp) => f(tmp.path)))
28
29describe("FileSystem", () => {
30 it.live("reads text and binary files", () =>

Callers 1

Calls 1

tmpdirFunction · 0.90

Tested by

no test coverage detected