From fcec6aeece183e47bdad6e5356033114d4adee59 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 17 Jun 2018 05:52:16 -0700 Subject: [PATCH] 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 --- fish_prompt.fish | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 2741c96..a359c55 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -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