mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-13 17:30:08 +00:00
Check bundler version to avoid error with unsupported command line arguments
This commit is contained in:
parent
61e3951e4b
commit
e8c3619486
1 changed files with 10 additions and 5 deletions
|
@ -4,13 +4,18 @@ alias bp="bundle package"
|
||||||
alias bo="bundle open"
|
alias bo="bundle open"
|
||||||
alias bu="bundle update"
|
alias bu="bundle update"
|
||||||
|
|
||||||
if [[ "$(uname)" == 'Darwin' ]]
|
bundler_version=`bundle version | cut -d' ' -f3`
|
||||||
then
|
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
|
||||||
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
|
if [[ "$(uname)" == 'Darwin' ]]
|
||||||
|
then
|
||||||
|
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
|
||||||
|
else
|
||||||
|
local cores_num="$(nproc)"
|
||||||
|
fi
|
||||||
|
eval "alias bi='bundle install --jobs=$cores_num'"
|
||||||
else
|
else
|
||||||
local cores_num="$(nproc)"
|
alias bi='bundle install'
|
||||||
fi
|
fi
|
||||||
eval "alias bi='bundle install --jobs=$cores_num'"
|
|
||||||
|
|
||||||
# The following is based on https://github.com/gma/bundler-exec
|
# The following is based on https://github.com/gma/bundler-exec
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue