1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 13:50:09 +00:00

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.
This commit is contained in:
Robin Daugherty 2015-08-26 13:24:59 -04:00
parent 192de6bcff
commit 241be2d28b

View file

@ -18,8 +18,8 @@ if [[ -x `which curl` ]]; then
W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g') W=$(echo "$Q" | sed -e 's/.*\/quotes\///g' -e 's/<.*//g' -e 's/.*">//g')
if [ "$W" -a "$TXT" ]; then if [ "$W" -a "$TXT" ]; then
echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}${TXT}${END_COLOR}" echo "${WHO_COLOR}${W}${COLON_COLOR}: ${TEXT_COLOR}${TXT}${END_COLOR}"
else # else
quote # quote
fi fi
} }
#quote #quote