Explorar el Código

Merge branch 'avoid-infinite-loop-even-if-pwd-returns-relative-path'

pull/100/head
Yamashita Yuu hace 10 años
padre
commit
f956502fd8
Se han modificado 2 ficheros con 5 adiciones y 4 borrados
  1. +2
    -2
      libexec/pyenv
  2. +3
    -2
      libexec/pyenv-version-file

+ 2
- 2
libexec/pyenv Ver fichero

@ -44,13 +44,13 @@ fi
export PYENV_ROOT
if [ -z "${PYENV_DIR}" ]; then
PYENV_DIR="$(abs_dirname "$(pwd)/..")"
PYENV_DIR="$(pwd)"
else
cd "$PYENV_DIR" 2>/dev/null || {
echo "pyenv: cannot change working directory to \`$PYENV_DIR'"
exit 1
} >&2
PYENV_DIR="$(abs_dirname "$(pwd)/..")"
PYENV_DIR="$(pwd)"
cd "$OLDPWD"
fi
export PYENV_DIR

+ 3
- 2
libexec/pyenv-version-file Ver fichero

@ -4,8 +4,8 @@ set -e
[ -n "$PYENV_DEBUG" ] && set -x
find_local_version_file() {
local root="$1"
while [ -n "$root" ]; do
local prev root="$1"
while [ -n "$root" ] && [ "$root" != "$prev" ]; do
if [ -e "${root}/.python-version" ]; then
echo "${root}/.python-version"
exit
@ -13,6 +13,7 @@ find_local_version_file() {
echo "${root}/.pyenv-version"
exit
fi
prev="${root}"
root="${root%/*}"
done
}

Cargando…
Cancelar
Guardar