diff options
-rw-r--r-- | plugins/bundler/bundler.plugin.zsh | 15 | ||||
-rw-r--r-- | themes/agnoster.zsh-theme | 2 |
2 files changed, 11 insertions, 6 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 diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c7a59ad0d..3ad4eff1f 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -137,7 +137,7 @@ prompt_dir() { # Virtualenv: current working virtualenv prompt_virtualenv() { local virtualenv_path="$VIRTUAL_ENV" - if [[ -n $virtualenv_path ]]; then + if [[ -n $virtualenv_path && -z $VIRTUAL_ENV_DISABLE_PROMPT ]]; then prompt_segment blue black "(`basename $virtualenv_path`)" fi } |