Use canonical name for VIRTUAL_ENV as a workaround for IPython (fixes #113)

This commit is contained in:
Yamashita, Yuu
2015-11-12 00:28:44 +00:00
parent 25bf4a6155
commit a73817eecc

View File

@@ -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