浏览代码

Verification of convert inside the function

Depending on when the path is declared this solution would work in any case
Eduardo San Martin Morote 10 年之前
父节点
当前提交
8309b0a19b
共有 1 个文件被更改,包括 7 次插入6 次删除
  1. 7 6
      plugins/catimg/catimg.plugin.zsh

+ 7 - 6
plugins/catimg/catimg.plugin.zsh

@@ -7,10 +7,11 @@
 # Github: https://github.com/posva/catimg                                      #
 ################################################################################
 
-if [[ -x  `which convert` ]]; then
-  function catimg() {
+
+function catimg() {
+  if [[ -x  `which convert` ]]; then
     zsh $ZSH/plugins/catimg/catimg.sh $@
-  }
-else
-  echo "catimg need convert (ImageMagick) to work)"
-fi
+  else
+    echo "catimg need convert (ImageMagick) to work)"
+  fi
+}