From c992995adb8c18c422e2ee75ebe19ecc37cb208a Mon Sep 17 00:00:00 2001 From: Oneric Date: Thu, 26 Sep 2024 02:21:58 +0200 Subject: [PATCH] Fix empty set detection A friendly error message here was a last minute addition, but untested and as it turns out broken. Due to piping the loop executes in a subshell and thus meta_prefix always retains its original value at the time of check. Instead actually test for anything being written out. --- yoink-or-update-emojipack.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yoink-or-update-emojipack.sh b/yoink-or-update-emojipack.sh index c5a0ff9..ab3326d 100755 --- a/yoink-or-update-emojipack.sh +++ b/yoink-or-update-emojipack.sh @@ -56,7 +56,7 @@ cat "$cached_list" \ fi done -if [ "$meta_prefix" = "{" ] ; then +if [ "$(wc -l "$META_ADD" | cut -d ' ' -f 1)" = "0" ] ; then echo "No emoji matched search criteria" rm "$META_ADD" exit 0