mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 07:16:18 -04:00
Remove unused code
The new implementation is not using realpath.
This commit is contained in:
parent
36eb43ebad
commit
4d2fd5dd3e
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue