mirror of
https://github.com/oh-my-fish/theme-bobthefish.git
synced 2025-06-13 13:03:54 +00:00
fish_prompt - __bobthefish_rvm_info: better rvm installation path search method
This commit is contained in:
parent
a5006c7491
commit
257e46d8a7
@ -584,12 +584,11 @@ end
|
|||||||
|
|
||||||
function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM'
|
function __bobthefish_rvm_info -S -d 'Current Ruby information from RVM'
|
||||||
# look for rvm install path
|
# look for rvm install path
|
||||||
[ -z "$__rvm_install_path" -a -n "$rvm_path" ] ; and set -Ux __rvm_install_path "$rvm_path"
|
set -q rvm_path
|
||||||
[ -z "$__rvm_install_path" -a -d /usr/local/rvm ] ; and set -Ux __rvm_install_path /usr/local/rvm
|
or set -l rvm_path ~/.rvm /usr/local/rvm
|
||||||
[ -z "$__rvm_install_path" -o ! -d "$__rvm_install_path" ] ; and set -Ux __rvm_install_path ~/.rvm
|
|
||||||
|
|
||||||
# More `sed`/`grep`/`cut` magic...
|
# 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)
|
set -l __rvm_current_ruby (rvm-prompt i v g)
|
||||||
[ "$__rvm_default_ruby" = "$__rvm_current_ruby" ]; and return
|
[ "$__rvm_default_ruby" = "$__rvm_current_ruby" ]; and return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user