Skip to content
Snippets Groups Projects
Commit eca16178 authored by Peter Armstrong's avatar Peter Armstrong
Browse files

rvm plugin fix #217

parent 454dcb7b
Branches
No related merge requests found
...@@ -3,8 +3,11 @@ function rvm -d 'Ruby enVironment Manager' ...@@ -3,8 +3,11 @@ function rvm -d 'Ruby enVironment Manager'
set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX) set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX)
bash -c '[ -e ~/.rvm/scripts/rvm ] && source ~/.rvm/scripts/rvm || source /usr/local/rvm/scripts/rvm; cd .;rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv bash -c '[ -e ~/.rvm/scripts/rvm ] && source ~/.rvm/scripts/rvm || source /usr/local/rvm/scripts/rvm; cd .;rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv
# grep the rvm_* *PATH RUBY_* GEM_* variables from the captured environment
# exclude lines with _clr and _debug
# apply rvm_* *PATH RUBY_* GEM_* variables from the captured environment # apply rvm_* *PATH RUBY_* GEM_* variables from the captured environment
and eval (grep '^rvm\|^[^=]*PATH\|^RUBY_\|^GEM_' $env_file |grep -v _clr| sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//')
and eval (grep '^rvm\|^[^=]*PATH\|^RUBY_\|^GEM_' $env_file |grep -v _clr| |grep -v _debug| sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//')
# clean up # clean up
rm -f $env_file rm -f $env_file
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment