From a5006c7491ec0b57a4ce32b73bfd1af4756f28f1 Mon Sep 17 00:00:00 2001 From: Alberto Cavalin Date: Tue, 20 Mar 2018 23:14:21 +0100 Subject: [PATCH] fish_prompt: fix __bobthefish_rvm_info for both rvm installation types (single/multi-user) --- fish_prompt.fish | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fish_prompt.fish b/fish_prompt.fish index 040c5c6..6778d7a 100644 --- a/fish_prompt.fish +++ b/fish_prompt.fish @@ -583,8 +583,13 @@ function __bobthefish_rvm_parse_ruby -S -a ruby_string scope -d 'Parse RVM Ruby 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 + # More `sed`/`grep`/`cut` magic... - set -l __rvm_default_ruby (grep GEM_HOME ~/.rvm/environments/default | sed -e"s/'//g" | sed -e's/.*\///') + set -l __rvm_default_ruby (grep GEM_HOME "$__rvm_install_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