Use glob to check if the virtualenv is inside pyenv's prefix or not

This commit is contained in:
Yamashita, Yuu
2015-11-24 00:04:18 +00:00
parent 4e9d697887
commit 0bbb12a3bf

View File

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