rvm.fish 411 B

12345678910111213141516
  1. #!/usr/bin/env fish
  2. function load_env_file
  3. sed -e "s/export\(.*\);\(.*\)=/set -x \1 /" -e "s/export\(.*\)=/set -x \1 /" -e 's/unset/set -e /' -e "/ PATH / s/[\"':]/ /g" -e 's/$/; /' < $argv | source
  4. end
  5. load_env_file ~/.rvm/environments/default
  6. function rvm
  7. switch $argv[1]
  8. case 'use'
  9. load_env_file (~/.rvm/bin/rvm $argv do rvm env --path | tail -n 1)
  10. case '*'
  11. ~/.rvm/bin/rvm $argv
  12. end
  13. end