浏览代码

Update colorize.plugin.zsh

correctly detect when pygmentize is not installed
do not exit shell if when pygmentize is not installed
Christophe Bliard 11 年之前
父节点
当前提交
3c41da3172
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      plugins/colorize/colorize.plugin.zsh

+ 3 - 3
plugins/colorize/colorize.plugin.zsh

@@ -6,9 +6,9 @@
 alias colorize='colorize_via_pygmentize'
 
 colorize_via_pygmentize() {
-    if [ ! -x $(which pygmentize) ]; then
-        echo package \'pygmentize\' is not installed!
-        exit -1
+    if [ ! -x "$(which pygmentize)" ]; then
+        echo "package \'pygmentize\' is not installed!"
+        return -1
     fi
 
     if [ $# -eq 0 ]; then