diff options
author | Robby Russell <robby@planetargon.com> | 2013-10-24 13:13:10 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-10-24 13:13:10 -0700 |
commit | 8f2e53c33e70ee35fda33419a7225d84c307bfc4 (patch) | |
tree | cb7a32a365bc9eea800a74289578cd3e1158db51 /plugins/bundler | |
parent | c79e5a97a906457d1778197bd4f29640d1917201 (diff) | |
parent | e8c3619486289fc21158ecd63d7fd91e3576c75c (diff) | |
download | zsh-8f2e53c33e70ee35fda33419a7225d84c307bfc4.tar.gz zsh-8f2e53c33e70ee35fda33419a7225d84c307bfc4.tar.bz2 zsh-8f2e53c33e70ee35fda33419a7225d84c307bfc4.zip |
Merge pull request #2107 from maxd/master
Check bundler version to avoid error with unsupported command line arguments
Diffstat (limited to 'plugins/bundler')
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 5bd28cbdc..2e657e5a8 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -4,13 +4,18 @@ alias bp="bundle package" alias bo="bundle open" alias bu="bundle update" -if [[ "$(uname)" == 'Darwin' ]] -then - local cores_num="$(sysctl hw.ncpu | awk '{print $2}')" +bundler_version=`bundle version | cut -d' ' -f3` +if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]; then + 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 - local cores_num="$(nproc)" + alias bi='bundle install' fi -eval "alias bi='bundle install --jobs=$cores_num'" # The following is based on https://github.com/gma/bundler-exec |