Omit functions and builtins when looking for ruby environment managers

This is especially important for asdf, because it turns out lots of people have aliases and functions called that :)

Fixes #160
pull/163/head
Justin Hileman 6 years ago
parent ed3ca3d618
commit fcec6aeece

@ -638,9 +638,9 @@ function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
[ "$theme_display_ruby" = 'no' ]; and return
set -l ruby_version
if type -q rvm-prompt
if type -fq rvm-prompt
set ruby_version (__bobthefish_rvm_info)
else if type -q rbenv
else if type -fq rbenv
set ruby_version (rbenv version-name)
# Don't show global ruby version...
set -q RBENV_ROOT
@ -653,9 +653,9 @@ function __bobthefish_prompt_rubies -S -d 'Display current Ruby information'
or set -l global_ruby_version system
[ "$ruby_version" = "$global_ruby_version" ]; and return
else if type -q chruby
else if type -q chruby # chruby is implemented as a function, so omitting the -f is intentional
set ruby_version $RUBY_VERSION
else if type -q asdf
else if type -fq asdf
asdf current ruby 2>/dev/null | read -l asdf_ruby_version asdf_provenance
or return

Loading…
Cancel
Save