return the search matches if code is not equal to zero#3114
Merged
sebjulliand merged 4 commits intocodefori:masterfrom Mar 31, 2026
Merged
return the search matches if code is not equal to zero#3114sebjulliand merged 4 commits intocodefori:masterfrom
sebjulliand merged 4 commits intocodefori:masterfrom
Conversation
sebjulliand
requested changes
Mar 17, 2026
Member
sebjulliand
left a comment
There was a problem hiding this comment.
A small change is in order. Avoid copy and pasting blocks of code 😄
Thanks!
src/api/SearchTools.ts
Outdated
Comment on lines
+125
to
+136
| term: searchTerm, | ||
| hits: parseGrepOutput(grepRes.stdout) | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
Do not copy/pastecode and just test the new condition in the existing if. Testing grepRes.stdoutfor falsiness is enough, too.
Suggested change
| } | |
| if (grepRes.code === 0 || grepRes.stdout) { | |
| return { | |
| term: searchTerm, | |
| hits: parseGrepOutput(grepRes.stdout) | |
| } | |
| } |
Collaborator
|
@rapra41 Your changes has been approved by @sebjulliand and the checks have passed. |
Member
|
@chrjorgensen I'll merge it; I don't think @rapra41 can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi @SanjulaGanepola , @worksofliam , I have added fallback handling in searchIFS function to return search results even when grep exits with a non-zero code but produces valid stdout output(e.g., when encountering permission issues on some files while still finding matches in accessible files).