Skip to content

Commit e8c8fd9

Browse files
authored
Fix errorneously creating a symlink inside env directory if running with -f (#496)
1 parent db299ca commit e8c8fd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/pyenv-virtualenv

+2-1
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,8 @@ fi
631631

632632
## Create symlink in the `versions` directory for backward compatibility
633633
if [ -d "${VIRTUALENV_PATH}" ] && [ -n "${COMPAT_VIRTUALENV_PATH}" ]; then
634-
ln -fs "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
634+
# Overwrite an existing link, can happen if running with -f
635+
ln -fsn "${VIRTUALENV_PATH}" "${COMPAT_VIRTUALENV_PATH}"
635636
fi
636637

637638
if [ ! -e "${VIRTUALENV_PATH}/bin/pydoc" ]; then

0 commit comments

Comments
 (0)