MCPcopy Create free account
hub / github.com/anomalyco/opencode / waitForFile

Function waitForFile

packages/core/test/util/effect-flock.test.ts:90–97  ·  view source on GitHub ↗
(file: string, timeout = 3_000)

Source from the content-addressed store, hash-verified

88}
89
90async function waitForFile(file: string, timeout = 3_000) {
91 const stop = Date.now() + timeout
92 while (Date.now() < stop) {
93 if (await exists(file)) return
94 await sleep(20)
95 }
96 throw new Error(`Timed out waiting for file: ${file}`)
97}
98
99// ---------------------------------------------------------------------------
100// Test layer

Callers 1

Calls 2

existsFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected