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

Function withFixedWorkspaceID

packages/opencode/test/fixture/flag.ts:10–20  ·  view source on GitHub ↗
(id: WorkspaceV2.ID)

Source from the content-addressed store, hash-verified

8 * preserves the original try/finally semantics regardless of test outcome.
9 */
10export function withFixedWorkspaceID(id: WorkspaceV2.ID): Effect.Effect<void, never, Scope.Scope> {
11 return Effect.gen(function* () {
12 const previous = Flag.OPENCODE_WORKSPACE_ID
13 Flag.OPENCODE_WORKSPACE_ID = id
14 yield* Effect.addFinalizer(() =>
15 Effect.sync(() => {
16 Flag.OPENCODE_WORKSPACE_ID = previous
17 }),
18 )
19 })
20}

Calls 1

syncMethod · 0.80

Tested by

no test coverage detected