mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
RBENV_DIR sets the directory from which .rbenv-version files are scanned
This commit is contained in:
parent
a3deeba0a0
commit
07815769ae
3 changed files with 9 additions and 7 deletions
|
@ -13,11 +13,8 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
cwd="$(pwd)"
|
if [ -z "$RBENV_DIR" ]; then
|
||||||
dirname="${1%/*}"
|
export RBENV_DIR="${1%/*}"
|
||||||
|
fi
|
||||||
cd "$dirname"
|
|
||||||
export RBENV_VERSION="$(rbenv version-name)"
|
|
||||||
cd "$cwd"
|
|
||||||
|
|
||||||
exec ruby "$@"
|
exec ruby "$@"
|
||||||
|
|
|
@ -27,6 +27,11 @@ else
|
||||||
fi
|
fi
|
||||||
export RBENV_ROOT
|
export RBENV_ROOT
|
||||||
|
|
||||||
|
if [ -z "${RBENV_DIR}" ]; then
|
||||||
|
RBENV_DIR="$(pwd)"
|
||||||
|
fi
|
||||||
|
export RBENV_DIR
|
||||||
|
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
set -e
|
set -e
|
||||||
[ -n "$RBENV_DEBUG" ] && set -x
|
[ -n "$RBENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
root="$(pwd)"
|
root="$RBENV_DIR"
|
||||||
while [ -n "$root" ]; do
|
while [ -n "$root" ]; do
|
||||||
if [ -e "${root}/.rbenv-version" ]; then
|
if [ -e "${root}/.rbenv-version" ]; then
|
||||||
echo "${root}/.rbenv-version"
|
echo "${root}/.rbenv-version"
|
||||||
|
|
Loading…
Reference in a new issue