Remove unused code

The new implementation is not using realpath.
This commit is contained in:
Sam Doran 2025-03-11 23:55:12 -04:00
parent 36eb43ebad
commit 4d2fd5dd3e
No known key found for this signature in database
GPG key ID: 01602635F94328AA

View file

@ -7,21 +7,6 @@
set -e
[ -n "$PYENV_DEBUG" ] && set -x
if [ -L "${BASH_SOURCE[0]}" ]; then
READLINK=$(type -p greadlink readlink | head -1)
if [ -z "$READLINK" ]; then
echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2
exit 1
fi
resolve_link() {
$READLINK -f "$1"
}
script_path=$(resolve_link "${BASH_SOURCE[0]}")
else
script_path="${BASH_SOURCE[0]}"
fi
. "${script_path%/*}"/../libexec/pyenv-virtualenv-realpath
if [ -z "$PYENV_ROOT" ]; then
PYENV_ROOT="${HOME}/.pyenv"
@ -49,39 +34,6 @@ done
versions_dir="${PYENV_ROOT}/versions"
if ! enable -f "${BASH_SOURCE%/*}"/pyenv-realpath.dylib realpath 2>/dev/null; then
if [ -n "$PYENV_NATIVE_EXT" ]; then
echo "pyenv: failed to load \`realpath' builtin" >&2
exit 1
fi
READLINK=$(type -P readlink)
if [ -z "$READLINK" ]; then
echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2
exit 1
fi
resolve_link() {
$READLINK "$1"
}
realpath() {
local path="$1"
local name
# Use a subshell to avoid changing the current path
(
while [ -n "$path" ]; do
name="${path##*/}"
[ "$name" = "$path" ] || cd "${path%/*}"
path="$(resolve_link "$name" || true)"
done
echo "${PWD}/$name"
)
}
fi
if [[ ${BASH_VERSINFO[0]} -gt 3 ]]; then
declare -A current_versions
else