Skip to content

return the search matches if code is not equal to zero#3114

Merged
sebjulliand merged 4 commits intocodefori:masterfrom
rapra41:fix/searchIFSTool_319
Mar 31, 2026
Merged

return the search matches if code is not equal to zero#3114
sebjulliand merged 4 commits intocodefori:masterfrom
rapra41:fix/searchIFSTool_319

Conversation

@rapra41
Copy link
Copy Markdown
Contributor

@rapra41 rapra41 commented Mar 17, 2026

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).

Copy link
Copy Markdown

@Mohammed-Yaseen-Ali-2081 Mohammed-Yaseen-Ali-2081 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Copy Markdown
Member

@sebjulliand sebjulliand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small change is in order. Avoid copy and pasting blocks of code 😄
Thanks!

Comment on lines +125 to +136
term: searchTerm,
hits: parseGrepOutput(grepRes.stdout)
}
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
}
}

@rapra41 rapra41 requested a review from sebjulliand March 17, 2026 08:10
Copy link
Copy Markdown
Member

@sebjulliand sebjulliand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine now; thanks.

@rapra41 rapra41 temporarily deployed to testing_environment March 31, 2026 09:00 — with GitHub Actions Inactive
@chrjorgensen
Copy link
Copy Markdown
Collaborator

@rapra41 Your changes has been approved by @sebjulliand and the checks have passed.
You're good to rebase and merge the changes into the main branch.

@sebjulliand
Copy link
Copy Markdown
Member

@chrjorgensen I'll merge it; I don't think @rapra41 can.

@sebjulliand sebjulliand merged commit 54a57b1 into codefori:master Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants