diff --git a/src/tools/glob/tools.ts b/src/tools/glob/tools.ts index cdfa983b4..919193fcf 100644 --- a/src/tools/glob/tools.ts +++ b/src/tools/glob/tools.ts @@ -26,9 +26,17 @@ export function createGlobTools(ctx: PluginInput): Record { try { const cli = await resolveGrepCliWithAutoInstall() +<<<<<<< HEAD const runtimeCtx = context as Record const dir = typeof runtimeCtx.directory === "string" ? runtimeCtx.directory : ctx.directory const searchPath = args.path ? resolve(dir, args.path) : dir +||||||| parent of 804d517f (fix(tools): resolve relative paths in glob/grep against project directory) + const searchPath = args.path ?? ctx.directory + const paths = [searchPath] +======= + const searchPath = args.path ? resolve(ctx.directory, args.path) : ctx.directory + const paths = [searchPath] +>>>>>>> 804d517f (fix(tools): resolve relative paths in glob/grep against project directory) const result = await runRgFiles( { diff --git a/src/tools/grep/tools.ts b/src/tools/grep/tools.ts index eaf8a3972..7b4502bef 100644 --- a/src/tools/grep/tools.ts +++ b/src/tools/grep/tools.ts @@ -37,9 +37,15 @@ export function createGrepTools(ctx: PluginInput): Record { try { const globs = args.include ? [args.include] : undefined +<<<<<<< HEAD const runtimeCtx = context as Record const dir = typeof runtimeCtx.directory === "string" ? runtimeCtx.directory : ctx.directory const searchPath = args.path ? resolve(dir, args.path) : dir +||||||| parent of 804d517f (fix(tools): resolve relative paths in glob/grep against project directory) + const searchPath = args.path ?? ctx.directory +======= + const searchPath = args.path ? resolve(ctx.directory, args.path) : ctx.directory +>>>>>>> 804d517f (fix(tools): resolve relative paths in glob/grep against project directory) const paths = [searchPath] const outputMode = args.output_mode ?? "files_with_matches" const headLimit = args.head_limit ?? 0