mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Simplify fallback to global version file
This commit is contained in:
parent
e199a3d8f7
commit
a95ccd09a2
1 changed files with 1 additions and 7 deletions
|
@ -19,16 +19,10 @@ find_local_version_file() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
find_global_version_file() {
|
|
||||||
local global_version_file="${RBENV_ROOT}/version"
|
|
||||||
|
|
||||||
echo "$global_version_file"
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -n "$target_dir" ]; then
|
if [ -n "$target_dir" ]; then
|
||||||
find_local_version_file "$target_dir"
|
find_local_version_file "$target_dir"
|
||||||
else
|
else
|
||||||
find_local_version_file "$RBENV_DIR" || {
|
find_local_version_file "$RBENV_DIR" || {
|
||||||
[ "$RBENV_DIR" != "$PWD" ] && find_local_version_file "$PWD"
|
[ "$RBENV_DIR" != "$PWD" ] && find_local_version_file "$PWD"
|
||||||
} || find_global_version_file
|
} || echo "${RBENV_ROOT}/version"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue