mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-20 01:12:15 +00:00
tweak: grep tool to handle single file better (#3004)
This commit is contained in:
parent
0534bc0c09
commit
06c42093c8
1 changed files with 1 additions and 2 deletions
|
|
@ -20,12 +20,11 @@ export const GrepTool = Tool.define("grep", {
|
|||
const searchPath = params.path || Instance.directory
|
||||
|
||||
const rgPath = await Ripgrep.filepath()
|
||||
const args = ["-n", params.pattern]
|
||||
const args = ["-nH", "--field-match-separator=|", params.pattern]
|
||||
if (params.include) {
|
||||
args.push("--glob", params.include)
|
||||
}
|
||||
args.push(searchPath)
|
||||
args.push("--field-match-separator=|")
|
||||
|
||||
const proc = Bun.spawn([rgPath, ...args], {
|
||||
stdout: "pipe",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue