Sha256: a6d5d2ff663638306710741c3dd2cafd3a0e6f3106a0d21423f7e4077bd59bef

Contents?: true

Size: 660 Bytes

Versions: 13

Compression:

Stored size: 660 Bytes

Contents

#!/usr/bin/env bash

# Source a .rvmrc file in a directory after changing to it, if it exists.
# To disable this fature, set rvm_project_rvmrc=0 in $HOME/.rvmrc
if [[ "$rvm_project_rvmrc" -ne 0 ]] ; then
  cd() {
    builtin cd "$@"
    local cwd ; cwd=$(pwd)
    while : ; do
      if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
        if [[ "$rvm_project_rvmrc_default" -eq 1 ]] ; then
          rvm default 1>/dev/null 2>&1
        fi
        break
      else
        if [[ -f "$cwd/.rvmrc" ]] ; then
          source "$cwd/.rvmrc"
          break
        else
          cwd=$(dirname "$cwd")
        fi
      fi
    done
  }
fi

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rvm-0.1.39 scripts/cd
rvm-0.1.38 scripts/cd
rvm-0.1.37 scripts/cd
rvm-0.1.36 scripts/cd
rvm-0.1.35 scripts/cd
rvm-0.1.34 scripts/cd
rvm-0.1.33 scripts/cd
rvm-0.1.32 scripts/cd
rvm-0.1.31 scripts/cd
rvm-0.1.30 scripts/cd
rvm-0.1.29 scripts/cd
rvm-0.1.27 scripts/cd
rvm-0.1.26 scripts/cd