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

Function withTmp

packages/core/test/file-mutation.test.ts:29–34  ·  view source on GitHub ↗
(f: (directory: string) => Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

27}
28
29function withTmp<A, E, R>(f: (directory: string) => Effect.Effect<A, E, R>) {
30 return Effect.acquireRelease(
31 Effect.promise(() => tmpdir()),
32 (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
33 ).pipe(Effect.flatMap((tmp) => f(tmp.path)))
34}
35
36describe("FileMutation", () => {
37 it.live("writes an existing internal file and returns a stable result", () =>

Callers 1

Calls 1

tmpdirFunction · 0.90

Tested by

no test coverage detected