Sha256: ed44ef4bb9e7fdad73586a102f6e0a858d2b26c2adc08d49b5b866ae963bc4c3

Contents?: true

Size: 591 Bytes

Versions: 2

Compression:

Stored size: 591 Bytes

Contents

#!/usr/bin/env bash

# Source a .rvmrc file in a directory after changing to it, if it exists.
cd() {
  builtin cd "$@"
  if [[ "$rvm_project_rvmrc" != 0 ]] ; then
    local cwd ; cwd=$(pwd)
    while : ; do
      if [[ -z "$cwd" ]] || [[ "$HOME" = "$cwd" ]] || [[ "/" = "$cwd" ]] ; then
        if [[ "$rvm_project_rvmrc_default" != 0 ]] ; 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

2 entries across 2 versions & 1 rubygems

Version Path
rvm-0.0.999 scripts/cd
rvm-0.0.99 scripts/cd