浏览代码

github plugin: check for `ruby`.

I've run into the issue where a stripped down container had no Ruby
installed, which caused `hub` to fail.

Therefore I've added an extra check to verify that `ruby` is in the
commands list before setting up this alias/function.
Daniel Hahler 14 年之前
父节点
当前提交
911837c48f
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      plugins/github/github.plugin.zsh

+ 2 - 3
plugins/github/github.plugin.zsh

@@ -1,6 +1,5 @@
-# hub alias from defunkt
-# https://github.com/defunkt/hub
-if [ "$commands[(I)hub]" ]; then
+# Setup hub function for git, if it is available; http://github.com/defunkt/hub
+if [ "$commands[(I)hub]" ] && [ "$commands[(I)ruby]" ]; then
     # eval `hub alias -s zsh`
     # eval `hub alias -s zsh`
     function git(){hub "$@"}
     function git(){hub "$@"}
 fi
 fi