overhaul file search and support @ mentioning directories
This commit is contained in:
@@ -40,12 +40,14 @@ const FilesCommand = cmd({
|
||||
}),
|
||||
async handler(args) {
|
||||
await bootstrap(process.cwd(), async () => {
|
||||
const files = await Ripgrep.files({
|
||||
const files: string[] = []
|
||||
for await (const file of Ripgrep.files({
|
||||
cwd: Instance.directory,
|
||||
query: args.query,
|
||||
glob: args.glob ? [args.glob] : undefined,
|
||||
limit: args.limit,
|
||||
})
|
||||
})) {
|
||||
files.push(file)
|
||||
if (args.limit && files.length >= args.limit) break
|
||||
}
|
||||
console.log(files.join("\n"))
|
||||
})
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user