Skip to content

Commit

Permalink
Exit cleanly if we find no results
Browse files Browse the repository at this point in the history
  • Loading branch information
aegilops committed Apr 18, 2023
1 parent 8e32092 commit b507679
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mrva-code-search
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ do_query() {
# if we're on page 1, grab the total expected, and work out how many pages we'll need to get all the results
if [ $page -eq 1 ]; then
total_count=$(echo "${response_json}" | jq '.total_count')

if [ $total_count -eq 0 ]; then
echo "No hits found, exiting"
exit 0
fi

total_pages=$((total_count / per_page + 1))
echo " (hits: ${total_count})"
fi
Expand Down Expand Up @@ -198,7 +204,7 @@ EOF
# get the databases.json file contents
databases_json=$(cat "$databases_json_path")

echo "$databases_json"
# echo "$databases_json"

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

0 comments on commit b507679

Please sign in to comment.