fixed colorize for OSX

exit -1 destroys a terminal, now returns -1
which doesn't return just a path, so awked out the last field
This commit is contained in:
Richard Maynard 2013-11-06 14:27:17 -06:00
commit e6483745a3

View file

@ -6,9 +6,9 @@
alias colorize='colorize_via_pygmentize' alias colorize='colorize_via_pygmentize'
colorize_via_pygmentize() { colorize_via_pygmentize() {
if [ ! -x $(which pygmentize) ]; then if [ ! -x $(which pygmentize | awk ' { print $(NF) } ') ]; then
echo package \'pygmentize\' is not installed! echo package \'pygmentize\' is not installed!
exit -1 return -1
fi fi
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
@ -25,4 +25,4 @@ colorize_via_pygmentize() {
pygmentize -g "$FNAME" pygmentize -g "$FNAME"
fi fi
done done
} }