From 241be2d28b41293f163c4be75bb122975c2eacd9 Mon Sep 17 00:00:00 2001 From: Robin Daugherty Date: Wed, 26 Aug 2015 13:24:59 -0400 Subject: [PATCH 1/2] 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. --- plugins/rand-quote/rand-quote.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index c3bf6234e..3c9722a73 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -18,8 +18,8 @@ if [[ -x `which curl` ]]; then W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g') if [ "$W" -a "$TXT" ]; then echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}“${TXT}”${END_COLOR}" - else - quote + # else + # quote fi } #quote From 96aefd2b98e5a646573a0ad6394f6ca0276facf1 Mon Sep 17 00:00:00 2001 From: Robin Daugherty Date: Wed, 26 Aug 2015 14:12:38 -0400 Subject: [PATCH 2/2] Remove code, not comment it out Gaaah. --- plugins/rand-quote/rand-quote.plugin.zsh | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index 3c9722a73..8f345d9aa 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -18,8 +18,6 @@ if [[ -x `which curl` ]]; then W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g') if [ "$W" -a "$TXT" ]; then echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}“${TXT}”${END_COLOR}" - # else - # quote fi } #quote