From 257e46d8a7fd5c21709a98e18d4d19eef5f2b9ce Mon Sep 17 00:00:00 2001 From: Alberto Cavalin Date: Wed, 21 Mar 2018 20:01:19 +0100 Subject: [PATCH] fish_prompt - __bobthefish_rvm_info: better rvm installation path search method --- fish_prompt.fish | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 6778d7a..aed1846 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -584,12 +584,11 @@ end function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM' # look for rvm install path - [ -z "$__rvm_install_path" -a -n "$rvm_path" ] ; and set -Ux __rvm_install_path "$rvm_path" - [ -z "$__rvm_install_path" -a -d /usr/local/rvm ] ; and set -Ux __rvm_install_path /usr/local/rvm - [ -z "$__rvm_install_path" -o ! -d "$__rvm_install_path" ] ; and set -Ux __rvm_install_path ~/.rvm + set -q rvm_path + or set -l rvm_path ~/.rvm /usr/local/rvm # More `sed`/`grep`/`cut` magic... - set -l __rvm_default_ruby (grep GEM_HOME "$__rvm_install_path"/environments/default | sed -e"s/'//g" | sed -e's/.*\///') + set -l __rvm_default_ruby (grep GEM_HOME $rvm_path/environments/default | sed -e"s/'//g" | sed -e's/.*\///') set -l __rvm_current_ruby (rvm-prompt i v g) [ "$__rvm_default_ruby" = "$__rvm_current_ruby" ]; and return