Merge pull request #2107 from maxd/master
Check bundler version to avoid error with unsupported command line arguments
This commit is contained in:
commit
8f2e53c33e
|
@ -4,6 +4,8 @@ alias bp="bundle package"
|
||||||
alias bo="bundle open"
|
alias bo="bundle open"
|
||||||
alias bu="bundle update"
|
alias bu="bundle update"
|
||||||
|
|
||||||
|
bundler_version=`bundle version | cut -d' ' -f3`
|
||||||
|
if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then
|
||||||
if [[ "$(uname)" == 'Darwin' ]]
|
if [[ "$(uname)" == 'Darwin' ]]
|
||||||
then
|
then
|
||||||
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
|
local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
|
||||||
|
@ -11,6 +13,9 @@ else
|
||||||
local cores_num="$(nproc)"
|
local cores_num="$(nproc)"
|
||||||
fi
|
fi
|
||||||
eval "alias bi='bundle install --jobs=$cores_num'"
|
eval "alias bi='bundle install --jobs=$cores_num'"
|
||||||
|
else
|
||||||
|
alias bi='bundle install'
|
||||||
|
fi
|
||||||
|
|
||||||
# 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