Created
June 11, 2012 08:29
-
-
Save lucas-clemente/2909083 to your computer and use it in GitHub Desktop.
Fix for .config/fish/functions/rvm.fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rvm -d 'Ruby enVironment Manager' | |
# run RVM and capture the resulting environment | |
set -l env_file (mktemp -t rvm.fish.XXXXXXXXXX) | |
bash -c 'source ~/.rvm/scripts/rvm; rvm "$@"; status=$?; env > "$0"; exit $status' $env_file $argv | |
# apply rvm_* and *PATH variables from the captured environment | |
and eval (grep '^rvm\|^[^=]*PATH' $env_file | sed '/^[^=]*PATH/y/:/ /; s/^/set -xg /; s/=/ /; s/$/ ;/; s/(//; s/)//') | |
# clean up | |
rm -f $env_file | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment