From 86aa9106090a0219bac30bc12f5a5bd91949afd9 Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 16 Nov 2024 11:09:40 +0800 Subject: refactor: improve bash code (#125) * refactor: extract guard_path to utils/guard_path.sh * add utils/guard_operation.sh --- tools/search_wikipedia.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/search_wikipedia.sh') diff --git a/tools/search_wikipedia.sh b/tools/search_wikipedia.sh index 0bf791e..6c7010d 100755 --- a/tools/search_wikipedia.sh +++ b/tools/search_wikipedia.sh @@ -17,7 +17,7 @@ main() { title="$(echo "$json" | jq -r '.query.search[0].title // empty')" pageid="$(echo "$json" | jq -r '.query.search[0].pageid // empty')" if [[ -z "$title" || -z "$pageid" ]]; then - echo "Error: No results found for '$argc_query'" + echo "error: no results for '$argc_query'" >&2 exit 1 fi title="$(echo "$title" | tr ' ' '_')" -- cgit v1.2.3