Merge pull request #610 from sjoeboo/rbenv_always
Add ability to always show rbenv prompt
This commit is contained in:
commit
9ab067bd62
2 changed files with 10 additions and 6 deletions
|
@ -1052,17 +1052,17 @@ prompt_ram() {
|
|||
}
|
||||
|
||||
# rbenv information
|
||||
set_default POWERLEVEL9K_RBENV_ALWAYS false
|
||||
prompt_rbenv() {
|
||||
if which rbenv 2>/dev/null >&2; then
|
||||
local rbenv_version_name="$(rbenv version-name)"
|
||||
local rbenv_global="$(rbenv global)"
|
||||
|
||||
# Don't show anything if the current Ruby is the same as the global Ruby.
|
||||
if [[ $rbenv_version_name == $rbenv_global ]]; then
|
||||
return
|
||||
# Don't show anything if the current Ruby is the same as the global Ruby
|
||||
# unless `POWERLEVEL9K_RBENV_ALWAYS` is set.
|
||||
if [[ $POWERLEVEL9K_RBENV_ALWAYS == true || $rbenv_version_name != $rbenv_global ]];then
|
||||
"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
|
||||
fi
|
||||
|
||||
"$1_prompt_segment" "$0" "$2" "red" "$DEFAULT_COLOR" "$rbenv_version_name" 'RUBY_ICON'
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue