From 4d2fd5dd3efaac05c8868824679ce25e7f7bea02 Mon Sep 17 00:00:00 2001 From: Sam Doran Date: Tue, 11 Mar 2025 23:55:12 -0400 Subject: [PATCH] Remove unused code The new implementation is not using realpath. --- bin/pyenv-virtualenvs | 48 ------------------------------------------- 1 file changed, 48 deletions(-) diff --git a/bin/pyenv-virtualenvs b/bin/pyenv-virtualenvs index 4671810..6898f73 100755 --- a/bin/pyenv-virtualenvs +++ b/bin/pyenv-virtualenvs @@ -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