feat: configurable instructions (#624)

This commit is contained in:
Aiden Cline
2025-07-02 22:27:04 -05:00
committed by GitHub
parent 67aa7ce04d
commit b99565959b
4 changed files with 50 additions and 0 deletions

View File

@@ -15,4 +15,28 @@ export namespace Filesystem {
}
return result
}
export async function globUp(pattern: string, start: string, stop?: string) {
let current = start
const result = []
while (true) {
try {
const glob = new Bun.Glob(pattern)
for await (const match of glob.scan({
cwd: current,
onlyFiles: true,
dot: true,
})) {
result.push(join(current, match))
}
} catch {
// Skip invalid glob patterns
}
if (stop === current) break
const parent = dirname(current)
if (parent === current) break
current = parent
}
return result
}
}