MCPcopy Index your code
hub / github.com/anomalyco/opencode / withRemote

Function withRemote

packages/core/test/git.test.ts:58–67  ·  view source on GitHub ↗
(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>)

Source from the content-addressed store, hash-verified

56})
57
58function withRemote<A, E, R>(body: (fixture: Awaited<ReturnType<typeof gitRemote>>) => Effect.Effect<A, E, R>) {
59 return Effect.acquireUseRelease(
60 Effect.promise(async () => {
61 const root = await tmpdir()
62 return { root, fixture: await gitRemote(root.path) }
63 }),
64 (input) => body(input.fixture),
65 (input) => Effect.promise(() => input.root[Symbol.asyncDispose]()),
66 )
67}
68
69function read(file: string) {
70 return Effect.promise(() => fs.readFile(file, "utf8")).pipe(Effect.map((content) => content.replace(/\r\n/g, "\n")))

Callers 1

git.test.tsFile · 0.70

Calls 3

tmpdirFunction · 0.90
gitRemoteFunction · 0.90
bodyFunction · 0.50

Tested by

no test coverage detected