mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2024-10-27 20:34:23 +00:00
Speed up rbenv prompt computation
ref: https://github.com/sstephenson/rbenv/issues/804
This commit is contained in:
parent
7221fb8a32
commit
30c1ff9d8e
@ -393,16 +393,15 @@ end
|
|||||||
|
|
||||||
function __bobthefish_prompt_rubies -d 'Display current Ruby (rvm/rbenv)'
|
function __bobthefish_prompt_rubies -d 'Display current Ruby (rvm/rbenv)'
|
||||||
[ "$theme_display_ruby" = 'no' ]; and return
|
[ "$theme_display_ruby" = 'no' ]; and return
|
||||||
set -l ruby_version
|
if which rvm-prompt >/dev/null 2>&1
|
||||||
if type rvm-prompt >/dev/null 2>&1
|
|
||||||
set ruby_version (rvm-prompt i v g)
|
set ruby_version (rvm-prompt i v g)
|
||||||
else if type rbenv >/dev/null 2>&1
|
else if which rbenv >/dev/null 2>&1
|
||||||
set ruby_version (rbenv version-name)
|
set ruby_version (rbenv version-name)
|
||||||
# Don't show global ruby version...
|
# Don't show global ruby version...
|
||||||
[ "$ruby_version" = (rbenv global) ]; and return
|
set -q RBENV_ROOT; and set rbenv_root $RBENV_ROOT; or set rbenv_root ~/.rbenv
|
||||||
|
[ "$ruby_version" = (cat $rbenv_root/version 2>/dev/null; or echo 'system') ]; and return
|
||||||
end
|
end
|
||||||
[ -z "$ruby_version" ]; and return
|
[ -z "$ruby_version" ]; and return
|
||||||
|
|
||||||
__bobthefish_start_segment $__bobthefish_ruby_red $__bobthefish_lt_grey --bold
|
__bobthefish_start_segment $__bobthefish_ruby_red $__bobthefish_lt_grey --bold
|
||||||
echo -n -s $ruby_version ' '
|
echo -n -s $ruby_version ' '
|
||||||
set_color normal
|
set_color normal
|
||||||
|
Loading…
Reference in New Issue
Block a user