浏览代码

Fix incorrect error message when running bi without having bundler installed (#7112)

Iulian Onofrei 5 年之前
父节点
当前提交
08a2808636
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      plugins/bundler/bundler.plugin.zsh

+ 6 - 4
plugins/bundler/bundler.plugin.zsh

@@ -54,8 +54,12 @@ done
 ## Functions
 
 bundle_install() {
-  if _bundler-installed && _within-bundled-project; then
-    local bundler_version=`bundle --version | cut -d' ' -f3`
+  if ! _bundler-installed; then
+    echo "Bundler is not installed"
+  elif ! _within-bundled-project; then
+    echo "Can't 'bundle install' outside a bundled project"
+  else
+    local bundler_version=`bundle version | cut -d' ' -f3`
     if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
       if [[ "$OSTYPE" = (darwin|freebsd)* ]]
       then
@@ -67,8 +71,6 @@ bundle_install() {
     else
       bundle install $@
     fi
-  else
-    echo "Can't 'bundle install' outside a bundled project"
   fi
 }