Improve conditions in `rbenv` & `pyenv`

pull/22/head
Alexara Wu 7 years ago
parent 9f09547ad1
commit 45fe401dc2
No known key found for this signature in database
GPG Key ID: 20807CF3A407E38D

@ -1270,7 +1270,7 @@ prompt_rbenv() {
elif [ $commands[rbenv] ]; then elif [ $commands[rbenv] ]; then
local rbenv_version_name="$(rbenv version-name)" local rbenv_version_name="$(rbenv version-name)"
local rbenv_global="$(rbenv global)" local rbenv_global="$(rbenv global)"
if ! [[ $rbenv_version_name == $rbenv_global && "$POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW" = false ]]; then if [[ "${rbenv_version_name}" != "${rbenv_global}" || "${POWERLEVEL9K_RBENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then
"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON' "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
fi fi
fi fi
@ -1635,7 +1635,7 @@ prompt_pyenv() {
elif [ $commands[pyenv] ]; then elif [ $commands[pyenv] ]; then
local pyenv_version_name="$(pyenv version-name)" local pyenv_version_name="$(pyenv version-name)"
local pyenv_global="$(pyenv version-file-read $(pyenv root)/version)" local pyenv_global="$(pyenv version-file-read $(pyenv root)/version)"
if ! [[ $pyenv_version_name == $pyenv_global && "$POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW" = false ]]; then if [[ "${pyenv_version_name}" != "${pyenv_global}" || "${POWERLEVEL9K_PYENV_PROMPT_ALWAYS_SHOW}" == "true" ]]; then
"$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version_name" 'PYTHON_ICON' "$1_prompt_segment" "$0" "$2" "blue" "$DEFAULT_COLOR" "$pyenv_version_name" 'PYTHON_ICON'
fi fi
fi fi

Loading…
Cancel
Save