Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/api/SearchTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ export namespace SearchTools {
hits: parseGrepOutput(grepRes.stdout)
}
}
else if(grepRes.stdout!==undefined && grepRes.stdout!==""){
return {
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)
}
}

} else {
throw new Error(`Grep must be installed on the remote system.`);
}
Expand Down