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.
This commit is contained in:
Oneric 2024-09-26 02:21:58 +02:00
parent 3947cad9ee
commit c992995adb

View file

@ -56,7 +56,7 @@ cat "$cached_list" \
fi fi
done done
if [ "$meta_prefix" = "{" ] ; then if [ "$(wc -l "$META_ADD" | cut -d ' ' -f 1)" = "0" ] ; then
echo "No emoji matched search criteria" echo "No emoji matched search criteria"
rm "$META_ADD" rm "$META_ADD"
exit 0 exit 0