Merge pull request #232 from logikone/fix-force-option

evaluate force flag before testing if venv exists
This commit is contained in:
Yamashita, Yuu
2017-09-11 10:19:52 +09:00
committed by GitHub

View File

@@ -349,10 +349,12 @@ if [[ "${VIRTUALENV_PATH/*/envs/*}" != "${PYENV_ROOT}/versions" ]]; then
fi fi
if [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then if [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
if [ -z ${FORCE} ]; then
if [ -e "${COMPAT_VIRTUALENV_PATH}" ] || [ -L "${COMPAT_VIRTUALENV_PATH}" ]; then if [ -e "${COMPAT_VIRTUALENV_PATH}" ] || [ -L "${COMPAT_VIRTUALENV_PATH}" ]; then
echo "pyenv-virtualenv: \`${COMPAT_VIRTUALENV_PATH}' already exists." 1>&2 echo "pyenv-virtualenv: \`${COMPAT_VIRTUALENV_PATH}' already exists." 1>&2
exit 1 exit 1
fi fi
fi
fi fi
unset HAS_VIRTUALENV unset HAS_VIRTUALENV