mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Fix grep and glob tools
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -51,7 +51,8 @@ export class GlobTool implements Tool<GlobParams> {
|
|||||||
|
|
||||||
if (args.path) {
|
if (args.path) {
|
||||||
// User explicitly specified a path parameter
|
// User explicitly specified a path parameter
|
||||||
searchPath = join(this.cwd, args.path);
|
// If path is absolute, use it directly; otherwise join with cwd
|
||||||
|
searchPath = args.path.startsWith('/') ? args.path : join(this.cwd, args.path);
|
||||||
pattern = args.pattern;
|
pattern = args.pattern;
|
||||||
} else {
|
} else {
|
||||||
// Parse the pattern to extract base directory
|
// Parse the pattern to extract base directory
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ export class GrepTool implements Tool<GrepParams> {
|
|||||||
throw new Error("pattern is required");
|
throw new Error("pattern is required");
|
||||||
}
|
}
|
||||||
|
|
||||||
const searchPath = args.path ? join(this.cwd, args.path) : this.cwd;
|
// If path is absolute, use it directly; otherwise join with cwd
|
||||||
|
const searchPath = args.path
|
||||||
|
? (args.path.startsWith('/') ? args.path : join(this.cwd, args.path))
|
||||||
|
: this.cwd;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Check if search path exists
|
// Check if search path exists
|
||||||
|
|||||||
Reference in new issue
Block a user