Truly make python an optional dependency of the sprunge plugin

This commit is contained in:
Simon Gomizelj 2011-11-29 11:10:56 -05:00
commit 21caf6ea77

View file

@ -48,6 +48,7 @@ FILENAMES
HERE HERE
} }
if (( $+commands[python] )); then
sprunge_syntax() { sprunge_syntax() {
echo "try: echo "try:
from pygments.lexers import get_lexer_for_filename from pygments.lexers import get_lexer_for_filename
@ -55,6 +56,9 @@ sprunge_syntax() {
except: except:
print('text')" | python print('text')" | python
} }
else
sprunge_syntax() { echo 'text' }
fi
sprunge() { sprunge() {
local urls url file syntax local urls url file syntax