08a280863661dd44aad20d494187d9c4ba12fac9

Author
Iulian Onofrei <6d0847b9@opayq.com>
Committer
Marc Cornellà <marc.cornella@live.com>
Date

Message

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

Diff

 1diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
 2index b0b286af5bf9fb3da76b4baed5586b602f221eb5..668e15d2f98a48f94ea2f098a136f3c7c5379df8 100644
 3--- a/plugins/bundler/bundler.plugin.zsh
 4+++ b/plugins/bundler/bundler.plugin.zsh
 5@@ -54,8 +54,12 @@ done
 6 ## Functions
 7 
 8 bundle_install() {
 9-  if _bundler-installed && _within-bundled-project; then
10-    local bundler_version=`bundle --version | cut -d' ' -f3`
11+  if ! _bundler-installed; then
12+    echo "Bundler is not installed"
13+  elif ! _within-bundled-project; then
14+    echo "Can't 'bundle install' outside a bundled project"
15+  else
16+    local bundler_version=`bundle version | cut -d' ' -f3`
17     if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
18       if [[ "$OSTYPE" = (darwin|freebsd)* ]]
19       then
20@@ -67,8 +71,6 @@ bundle_install() {
21     else
22       bundle install $@
23     fi
24-  else
25-    echo "Can't 'bundle install' outside a bundled project"
26   fi
27 }
28