mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-10 20:43: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
|
set -e
|
||||||
[ -n "$PYENV_DEBUG" ] && set -x
|
[ -n "$PYENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
|
resolve_link() {
|
||||||
|
$(type -p greadlink readlink | head -1) "$1"
|
||||||
|
}
|
||||||
|
|
||||||
unset FORCE
|
unset FORCE
|
||||||
unset QUIET
|
unset QUIET
|
||||||
unset VERBOSE
|
unset VERBOSE
|
||||||
@@ -86,6 +90,10 @@ done
|
|||||||
shell="${PYENV_SHELL:-${SHELL##*/}}"
|
shell="${PYENV_SHELL:-${SHELL##*/}}"
|
||||||
prefix="$(pyenv-prefix "${venv}")"
|
prefix="$(pyenv-prefix "${venv}")"
|
||||||
|
|
||||||
|
if [ -L "${prefix}" ]; then
|
||||||
|
prefix="$(resolve_link "${prefix}" 2>/dev/null)"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${VIRTUAL_ENV}" == "${prefix}" ]]; then
|
if [[ "${VIRTUAL_ENV}" == "${prefix}" ]]; then
|
||||||
if [ -z "${QUIET}" ]; then
|
if [ -z "${QUIET}" ]; then
|
||||||
echo "pyenv-virtualenv: version \`${venv}' is already activated" 1>&2
|
echo "pyenv-virtualenv: version \`${venv}' is already activated" 1>&2
|
||||||
|
|||||||
Reference in New Issue
Block a user