check if toot is installed

This commit is contained in:
Massimo Scagliola 2024-04-29 17:09:18 +02:00
parent a188677c49
commit 0eab42ddf1
2 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ If I had to choose a license, it would be [MIT](LICENSE.md).
## Dependencies
- `wget`
- `toot` (optional for posting on Mastodon)
## TO DO

View File

@ -104,6 +104,10 @@ echo "\nCopy and Paste this:\n\n+++++"
echo "Latest article from my blog: \"$TITLE\"\n\n$LINK"
echo "+++++"
if [[ "$TOOT" == "1" ]]; then yes_or_no "Post it on Mastodon?"; fi
if [[ "$TOOT" == "1" ]]; then
which toot > /dev/null # Check if toot is installed
if ! [[ $? == "0" ]]; then echo "ERROR. Toot is not installed. Exiting."; cleanup 1; fi
yes_or_no "Post it on Mastodon?"
fi
cleanup 0