Skip to content

Commit

Permalink
Omit functions and builtins when looking for ruby environment managers
Browse files Browse the repository at this point in the history
This is especially important for asdf, because it turns out lots of people have aliases and functions called that :)

Fixes #160
  • Loading branch information
bobthecow committed Jun 17, 2018
1 parent ed3ca3d commit fcec6ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fish_prompt.fish
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit fcec6ae

Please sign in to comment.