1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 14:23:53 -05:00

simplicy the check for infinite loop

This commit is contained in:
Yamashita Yuu
2014-01-06 16:37:21 +09:00
parent 8e02b93e39
commit 71a916faf2

View File

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