241be2d28b41293f163c4be75bb122975c2eacd9

Author
Robin Daugherty <robin@robindaugherty.net>
Committer
Robin Daugherty <robin@robindaugherty.net>
Date

Message

Fix rand-quote failure when site is unreachable

This plugin was designed so that if there is any failure, it will simply call itself recursively. Which means that if you were working offline, if `quote` was called in your `.zshrc`, you would be unable to open a new terminal session.

I fixed this by allowing the plugin to output nothing if a quote could not be fetched.

Diff

 1diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh
 2index c3bf6234ec61157034f1080d3bed8c1257a2f551..3c9722a731465d71d2cd971f19fe6892ddea82e4 100644
 3--- a/plugins/rand-quote/rand-quote.plugin.zsh
 4+++ b/plugins/rand-quote/rand-quote.plugin.zsh
 5@@ -18,8 +18,8 @@ if [[ -x `which curl` ]]; then
 6         W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
 7         if [ "$W" -a "$TXT" ]; then
 8           echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}“${TXT}”${END_COLOR}"
 9-        else
10-          quote
11+        # else
12+        #   quote
13         fi
14     }
15     #quote