MCPcopy Create free account
hub / github.com/arctic-cli/interface / findUp

Function findUp

packages/arctic/src/util/filesystem.ts:15–27  ·  view source on GitHub ↗
(target: string, start: string, stop?: string)

Source from the content-addressed store, hash-verified

13 }
14
15 export async function findUp(target: string, start: string, stop?: string) {
16 let current = start
17 const result = []
18 while (true) {
19 const search = join(current, target)
20 if (await exists(search)) result.push(search)
21 if (stop === current) break
22 const parent = dirname(current)
23 if (parent === current) break
24 current = parent
25 }
26 return result
27 }
28
29 export async function* up(options: { targets: string[]; start: string; stop?: string }) {
30 const { targets, start, stop } = options

Callers

nothing calls this directly

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected