From 0bbb12a3bf1e65b29837899f32ebb27ef619e17c Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 24 Nov 2015 00:04:18 +0000 Subject: [PATCH] Use glob to check if the virtualenv is inside pyenv's prefix or not --- bin/pyenv-sh-activate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/pyenv-sh-activate b/bin/pyenv-sh-activate index 007fdbc..87d0e41 100755 --- a/bin/pyenv-sh-activate +++ b/bin/pyenv-sh-activate @@ -70,7 +70,7 @@ fi venv="${versions}" # exit as success if some virtualenv outside from pyenv is already activated -if [ -n "${VIRTUAL_ENV}" ] && [[ "${VIRTUAL_ENV}" == "${VIRTUAL_ENV#${PYENV_ROOT}/versions/}" ]]; then +if [ -n "${VIRTUAL_ENV}" ] && [[ "${VIRTUAL_ENV}" != "${PYENV_ROOT}/versions/"* ]]; then if [ -z "${FORCE}" ]; then if [ -z "${QUIET}" ]; then echo "pyenv-virtualenv: virtualenv \`${VIRTUAL_ENV}' is already activated" 1>&2