mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-08 11:33:55 -05:00
Use canonical name for VIRTUAL_ENV as a workaround for IPython (fixes #113)
This commit is contained in:
@@ -14,6 +14,10 @@
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
resolve_link() {
|
||||
$(type -p greadlink readlink | head -1) "$1"
|
||||
}
|
||||
|
||||
unset FORCE
|
||||
unset QUIET
|
||||
unset VERBOSE
|
||||
@@ -86,6 +90,10 @@ done
|
||||
shell="${PYENV_SHELL:-${SHELL##*/}}"
|
||||
prefix="$(pyenv-prefix "${venv}")"
|
||||
|
||||
if [ -L "${prefix}" ]; then
|
||||
prefix="$(resolve_link "${prefix}" 2>/dev/null)"
|
||||
fi
|
||||
|
||||
if [[ "${VIRTUAL_ENV}" == "${prefix}" ]]; then
|
||||
if [ -z "${QUIET}" ]; then
|
||||
echo "pyenv-virtualenv: version \`${venv}' is already activated" 1>&2
|
||||
|
||||
Reference in New Issue
Block a user