Function
globUp
(pattern: string, start: string, stop?: string)
Source from the content-addressed store, hash-verified
| 42 | } |
| 43 | |
| 44 | export async function globUp(pattern: string, start: string, stop?: string) { |
| 45 | let current = start |
| 46 | const result = [] |
| 47 | while (true) { |
| 48 | try { |
| 49 | const glob = new Bun.Glob(pattern) |
| 50 | for await (const match of glob.scan({ |
| 51 | cwd: current, |
| 52 | absolute: true, |
| 53 | onlyFiles: true, |
| 54 | followSymlinks: true, |
| 55 | dot: true, |
| 56 | })) { |
| 57 | result.push(match) |
| 58 | } |
| 59 | } catch { |
| 60 | // Skip invalid glob patterns |
| 61 | } |
| 62 | if (stop === current) break |
| 63 | const parent = dirname(current) |
| 64 | if (parent === current) break |
| 65 | current = parent |
| 66 | } |
| 67 | return result |
| 68 | } |
| 69 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected