chruby.sh 920 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env bash
  2. # Set RUBIES when sourced.
  3. RUBIES=($( \command \ls -1d "$rvm_path/rubies"/* 2>/dev/null ))
  4. # Install rubies via rvm and reload RUBIES
  5. function mrvm()
  6. {
  7. \typeset __result=0
  8. # duplication marker jdgkjnfnkjdngjkfnd4fd
  9. if
  10. [[ -z "$rvm_path" ]]
  11. then
  12. \typeset reset_rvm_path=true
  13. if [[ -n "${BASH_SOURCE:-$_}" && -f "${BASH_SOURCE:-$_}" ]]
  14. then
  15. export rvm_path="${BASH_SOURCE:-$_}"
  16. rvm_path="$( \command \cd "${rvm_path%/scripts/extras/chruby.sh}">/dev/null; pwd )"
  17. elif [[ -x "$HOME/.rvm/bin/rvm" ]]
  18. then export rvm_path="$HOME/.rvm"
  19. elif [[ -x "/usr/local/rvm/bin/rvm" ]]
  20. then export rvm_path="/usr/local/rvm"
  21. else return 127
  22. fi
  23. fi
  24. "$rvm_path/bin/rvm" "$@" || __result=$?
  25. RUBIES=($( \command \ls -1d "$rvm_path/rubies"/* 2>/dev/null ))
  26. if [[ -n "${reset_rvm_path:-}" ]]
  27. then unset rvm_path reset_rvm_path
  28. fi
  29. return ${__result}
  30. }