Upgrade uninstall hook after pyenv/pyenv#2432 (#438)

This commit is contained in:
laggardkernel
2022-10-11 01:34:24 +08:00
committed by GitHub
parent c6ff093344
commit a911a2223f

View File

@@ -2,7 +2,8 @@ resolve_link() {
$(type -p greadlink readlink | head -1) "$1"
}
if [ -n "${DEFINITION}" ]; then
uninstall_related_virtual_env() {
if [ -n "${DEFINITION}" ]; then
if [[ "${DEFINITION}" != "${DEFINITION%/envs/*}" ]]; then
# Uninstall virtualenv by long name
exec pyenv-virtualenv-delete ${FORCE+-f} "${DEFINITION}"
@@ -27,4 +28,7 @@ if [ -n "${DEFINITION}" ]; then
shopt -u nullglob
fi
fi
fi
fi
}
before_uninstall "uninstall_related_virtual_env"