Do not output empty recommendation. - annna - Annna the nice friendly bot. | |
git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws6… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
--- | |
commit b78b233f0d9ed287e7b82fd5b0e3c4e7c188d4f7 | |
parent 37acc0ebfb3bea9fe8a0840350803674cd923f7b | |
Author: Annna Robert-Houdin <[email protected]> | |
Date: Mon, 31 May 2021 11:27:20 +0200 | |
Do not output empty recommendation. | |
Diffstat: | |
M gutenberg-news | 8 ++++++-- | |
1 file changed, 6 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/gutenberg-news b/gutenberg-news | |
@@ -1,5 +1,7 @@ | |
#!/bin/sh | |
+set -x | |
+ | |
export PATH="$HOME/bin:$PATH" | |
bookchannel="#bitreich-books" | |
@@ -8,6 +10,8 @@ bookrec="$(curl -s gopher://gopher.icu/0/gutenberg/newbooks.at… | |
| sfeed \ | |
| sed 's,^[0-9]*\t\([^\t]*\)\t\([^\t]*\).*,\1 ( \2 ),' \ | |
| shuf -n 1)" | |
- | |
-annna-say -c "${bookchannel}" "Today's book recommendation: ${bookrec}" | |
+if [ -n "${bookrec}" ]; | |
+then | |
+ annna-say -c "${bookchannel}" "Today's book recommendation: ${bookrec}" | |
+fi | |