mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-13 13:53:53 -05:00
Simplify fallback to global version file
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user