Sha256: ae03bd5104a79df10ee5c8087b2b9d7b8211dfc18e5812f62a175235c61a1752

Contents?: true

Size: 992 Bytes

Versions: 28

Compression:

Stored size: 992 Bytes

Contents

#!/usr/bin/env bash

__rvm_shell_lookup_script() {
  local relative_scripts_dir
  relative_scripts_dir="$(dirname -- "$(dirname -- "$0")")/scripts"
  for directory in "$rvm_path/scripts" "$HOME/.rvm/scripts" "/usr/local/rvm/scripts" "$relative_scripts_dir"; do
    if [[ -d "$directory" && -s "$directory/rvm" ]]; then
      echo "$directory/rvm"
      return
    fi
  done
}

# If the first argument isn't -c, remove it and set it to the ruby string value.
if [[ -n "$1" && ! -f "$1" && -n "$(echo "$1" | \grep -v '^-')" ]]; then
  rvm_shell_ruby_string="$1"
  shift
fi

rvm_shell_rvm_path="$(__rvm_shell_lookup_script)"
if [[ -n "$rvm_shell_rvm_path" ]]; then
  source "$rvm_shell_rvm_path"
  # Setup as expected.
  if [[ -n "$rvm_shell_ruby_string" ]]; then
      rvm "$rvm_shell_ruby_string"
      if [[ "$?" -gt 0 ]]; then
        echo "Error: RVM was unable to use '$rvm_shell_ruby_string'" 1>&2
        exit 1
      fi
  else
    rvm rvmrc load >/dev/null 2>&1
  fi
fi

exec bash "$@"

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
gemrage-0.1.2 vendor/ruby/1.8/gems/rvm-1.0.14/binscripts/rvm-shell
rvm-1.0.14 binscripts/rvm-shell
rvm-1.0.13 binscripts/rvm-shell
rvm-1.0.11 binscripts/rvm-shell
rvm-1.0.10 binscripts/rvm-shell
rvm-1.0.9 binscripts/rvm-shell
rvm-1.0.8 binscripts/rvm-shell
rvm-1.0.7 binscripts/rvm-shell