1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-16 09:50:06 +00:00

add ability to force rbenv being shown

This commit is contained in:
Matt Nicholson 2017-08-17 10:45:45 -04:00
parent 9f4faf7f21
commit 79a73ef4aa
2 changed files with 12 additions and 4 deletions

View file

@ -500,6 +500,10 @@ It figures out the version being used by taking the output of the `rbenv version
* If `rbenv` is not in $PATH, nothing will be shown. * If `rbenv` is not in $PATH, nothing will be shown.
* If the current Ruby version is the same as the global Ruby version, nothing will be shown. * If the current Ruby version is the same as the global Ruby version, nothing will be shown.
Variable | Default Value | Description |
|----------|---------------|-------------|
|`POWERLEVEL9K_RBENV_ALWAYS`|'false'|Always show rbenv version, even if global|
##### rspec_stats ##### rspec_stats
See [Unit Test Ratios](#unit-test-ratios), below. See [Unit Test Ratios](#unit-test-ratios), below.

View file

@ -1047,11 +1047,15 @@ prompt_rbenv() {
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.
if [[ $rbenv_version_name == $rbenv_global ]]; then # Unless POWERLEVEL_RBENV_ALWAYS is set.
return set_default POWERLEVEL9K_RBENV_ALWAYS false
fi 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
} }