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

Function withTmp

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

Source from the content-addressed store, hash-verified

22}
23
24function withTmp<A, E, R>(f: (directory: string) => Effect.Effect<A, E, R>) {
25 return Effect.acquireRelease(
26 Effect.promise(() => tmpdir()),
27 (tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]()),
28 ).pipe(Effect.flatMap((tmp) => f(tmp.path)))
29}
30
31describe("LocationMutation", () => {
32 it.live("resolves an active relative existing file target", () =>

Callers 1

Calls 1

tmpdirFunction · 0.90

Tested by

no test coverage detected