| 211 | } |
| 212 | |
| 213 | export 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 | |
| 228 | export async function globUp(pattern: string, start: string, stop?: string) { |
| 229 | let current = start |