mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
simplicy the check for infinite loop
This commit is contained in:
parent
8e02b93e39
commit
71a916faf2
1 changed files with 3 additions and 3 deletions
|
@ -4,8 +4,8 @@ set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
find_local_version_file() {
|
find_local_version_file() {
|
||||||
local prev root="$1"
|
local root="$1"
|
||||||
while [ -n "$root" ] && [ "$root" != "$prev" ]; do
|
while [ -n "$root" ]; do
|
||||||
if [ -e "${root}/.python-version" ]; then
|
if [ -e "${root}/.python-version" ]; then
|
||||||
echo "${root}/.python-version"
|
echo "${root}/.python-version"
|
||||||
exit
|
exit
|
||||||
|
@ -13,7 +13,7 @@ find_local_version_file() {
|
||||||
echo "${root}/.pyenv-version"
|
echo "${root}/.pyenv-version"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
prev="${root}"
|
[ "${root}" = "${root%/*}" ] && break
|
||||||
root="${root%/*}"
|
root="${root%/*}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue