summaryrefslogtreecommitdiff
path: root/plugins/bundler/bundler.plugin.zsh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/bundler/bundler.plugin.zsh')
-rw-r--r--plugins/bundler/bundler.plugin.zsh14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
index dfff6956e..668e15d2f 100644
--- a/plugins/bundler/bundler.plugin.zsh
+++ b/plugins/bundler/bundler.plugin.zsh
@@ -2,6 +2,7 @@ alias be="bundle exec"
alias bl="bundle list"
alias bp="bundle package"
alias bo="bundle open"
+alias bout="bundle outdated"
alias bu="bundle update"
alias bi="bundle_install"
alias bcn="bundle clean"
@@ -13,6 +14,7 @@ bundled_commands=(
cucumber
foodcritic
guard
+ hanami
irb
jekyll
kitchen
@@ -52,12 +54,16 @@ done
## Functions
bundle_install() {
- if _bundler-installed && _within-bundled-project; then
+ 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* ]]
+ if [[ "$OSTYPE" = (darwin|freebsd)* ]]
then
- local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
+ local cores_num="$(sysctl -n hw.ncpu)"
else
local cores_num="$(nproc)"
fi
@@ -65,8 +71,6 @@ bundle_install() {
else
bundle install $@
fi
- else
- echo "Can't 'bundle install' outside a bundled project"
fi
}