Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 54 lines (44 sloc) 1.383 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#!/usr/bin/env bash

if [[ -z "$rvm_ignore_rvmrc" ]]; then
  for rvmrc in /etc/rvmrc "$HOME/.rvmrc" ; do
    if [[ -f "$rvmrc" ]] ; then
      if \grep -q '^\s*rvm .*$' "$rvmrc" ; then
        printf "\nError: $rvmrc is for rvm settings only.\nrvm CLI may NOT be called from within $rvmrc. \nSkipping the loading of $rvmrc"
        exit 1
      else
        source "$rvmrc"
      fi
    fi
  done
fi

[[ -z "$rvm_prefix" ]] && unset rvm_prefix
[[ -z "$rvm_path" ]] && unset rvm_path

# Setup default sandbox value. See scripts/rvm for origin.
if [[ -z "$rvm_selfcontained" ]]; then
  if [[ "root" = "$(whoami)" ]] || [[ -n "$rvm_prefix" && "$rvm_prefix" != "$HOME"/* ]]; then
    rvm_selfcontained=0
  else
    rvm_selfcontained=1
  fi
fi

if [[ -z "$rvm_prefix" ]] ; then
  if [[ "$rvm_selfcontained" = "0" ]] ; then
    rvm_prefix="/usr/local/"
  else
    rvm_prefix="$HOME/."
  fi
fi

# Fix rvm_prefix changes.
echo "$rvm_prefix" | \grep -vq '\(\/\|\.\)$' && [[ -d "$rvm_prefix/rvm/scripts" ]]
rvm_prefix_needs_trailing_slash="$?"
if [[ "$rvm_prefix" = "/usr/local" || "$rvm_prefix_needs_trailing_slash" = "0" ]]; then
  rvm_prefix="$rvm_prefix/"
fi
unset rvm_prefix_needs_trailing_slash

if [[ -z "$rvm_path" ]] ; then
  rvm_path="${rvm_prefix}rvm"
fi
rvm_scripts_path="${rvm_scripts_path:-"$rvm_path/scripts"}"

source "$rvm_scripts_path/rvm"

unset rvm_interactive

rvm "$@"
Something went wrong with that request. Please try again.