Skip to content

Instantly share code, notes, and snippets.

@lucas-clemente
Created June 11, 2012 08:29
Show Gist options
  • Save lucas-clemente/2909083 to your computer and use it in GitHub Desktop.
Save lucas-clemente/2909083 to your computer and use it in GitHub Desktop.
Fix for .config/fish/functions/rvm.fish
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