(input GrepSearchInput, execCtx ExecutionContext)
| 51 | } |
| 52 | |
| 53 | func BackfillGrepSearchInput(input GrepSearchInput, execCtx ExecutionContext) GrepSearchInput { |
| 54 | path := input.Path |
| 55 | if path == "" { |
| 56 | path = "." |
| 57 | } |
| 58 | if path != "." && !filepath.IsAbs(path) { |
| 59 | cwd := stringFromExecCtx(execCtx, "cwd") |
| 60 | if cwd == "" { |
| 61 | cwd = "." |
| 62 | } |
| 63 | if resolved, err := filepath.Abs(filepath.Join(cwd, path)); err == nil { |
| 64 | path = resolved |
| 65 | } else { |
| 66 | path = filepath.Join(cwd, path) |
| 67 | } |
| 68 | } |
| 69 | return GrepSearchInput{ |
| 70 | Pattern: input.Pattern, |
| 71 | Path: path, |
| 72 | Glob: input.Glob, |
| 73 | HeadLimit: grepHeadLimit(input.HeadLimit), |
| 74 | OutputMode: grepOutputMode(input.OutputMode), |
| 75 | CaseInsensitive: input.CaseInsensitive, |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | func RenderGlobMatchToolUse(input GlobMatchInput) string { |
| 80 | target := "." |
no test coverage detected