mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-13 05:53:52 -05:00
evaluate force flag before testing if venv exists
fixes #161, fixes #187
This commit is contained in:
@@ -349,9 +349,11 @@ if [[ "${VIRTUALENV_PATH/*/envs/*}" != "${PYENV_ROOT}/versions" ]]; then
|
||||
fi
|
||||
|
||||
if [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
|
||||
if [ -e "${COMPAT_VIRTUALENV_PATH}" ] || [ -L "${COMPAT_VIRTUALENV_PATH}" ]; then
|
||||
echo "pyenv-virtualenv: \`${COMPAT_VIRTUALENV_PATH}' already exists." 1>&2
|
||||
exit 1
|
||||
if [ -z ${FORCE} ]; then
|
||||
if [ -e "${COMPAT_VIRTUALENV_PATH}" ] || [ -L "${COMPAT_VIRTUALENV_PATH}" ]; then
|
||||
echo "pyenv-virtualenv: \`${COMPAT_VIRTUALENV_PATH}' already exists." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user