Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit b507679

Browse files
committed
Exit cleanly if we find no results
1 parent 8e32092 commit b507679

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

mrva-code-search

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ do_query() {
104104
# if we're on page 1, grab the total expected, and work out how many pages we'll need to get all the results
105105
if [ $page -eq 1 ]; then
106106
total_count=$(echo "${response_json}" | jq '.total_count')
107+
108+
if [ $total_count -eq 0 ]; then
109+
echo "No hits found, exiting"
110+
exit 0
111+
fi
112+
107113
total_pages=$((total_count / per_page + 1))
108114
echo " (hits: ${total_count})"
109115
fi
@@ -198,7 +204,7 @@ EOF
198204
# get the databases.json file contents
199205
databases_json=$(cat "$databases_json_path")
200206

201-
echo "$databases_json"
207+
# echo "$databases_json"
202208

203209
# insert the list of repos into the databases.json file
204210
# if an entry with a matching name already exists in the JSON, add any new ones

0 commit comments

Comments
 (0)