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

Function up

packages/opencode/src/util/filesystem.ts:213–226  ·  view source on GitHub ↗
(options: { targets: string[]; start: string; stop?: string })

Source from the content-addressed store, hash-verified

211}
212
213export async function* up(options: { targets: string[]; start: string; stop?: string }) {
214 const { targets, start, stop } = options
215 let current = start
216 while (true) {
217 for (const target of targets) {
218 const search = join(current, target)
219 if (await exists(search)) yield search
220 }
221 if (stop === current) break
222 const parent = dirname(current)
223 if (parent === current) break
224 current = parent
225 }
226}
227
228export async function globUp(pattern: string, start: string, stop?: string) {
229 let current = start

Callers

nothing calls this directly

Calls 2

joinFunction · 0.85
existsFunction · 0.70

Tested by

no test coverage detected