1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 02:00:07 +00:00

Final cleanup for new POWERLEVEL9K_RBENV_ALWAYS flag

This commit is contained in:
Ben Hilburn 2017-09-28 17:27:59 -04:00 committed by GitHub
parent 095351cfe1
commit 748f9868fc

View file

@ -1041,20 +1041,16 @@ prompt_ram() {
} }
# rbenv information # rbenv information
set_default POWERLEVEL9K_RBENV_ALWAYS false
prompt_rbenv() { prompt_rbenv() {
if which rbenv 2>/dev/null >&2; then if which rbenv 2>/dev/null >&2; 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)"
# Don't show anything if the current Ruby is the same as the global Ruby. # Don't show anything if the current Ruby is the same as the global Ruby
# Unless POWERLEVEL_RBENV_ALWAYS is set. # unless `POWERLEVEL9K_RBENV_ALWAYS` is set.
set_default POWERLEVEL9K_RBENV_ALWAYS false
if [[ $POWERLEVEL9K_RBENV_ALWAYS == true || $rbenv_version_name != $rbenv_global ]];then if [[ $POWERLEVEL9K_RBENV_ALWAYS == true || $rbenv_version_name != $rbenv_global ]];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'
#elif [[ $rbenv_version_name != $rbenv_global ]]; then
# "$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
#else
# return
fi fi
fi fi
} }