cleanup pyenv virtualenv on ERR

also cleanup compatibility paths
This commit is contained in:
Luis Marsano
2018-11-16 04:38:26 -05:00
parent e0a1e9b35c
commit ed779fea14

View File

@@ -537,10 +537,11 @@ for hook in "${before_hooks[@]}"; do eval "$hook"; done
# Plan cleanup on unsuccessful installation.
cleanup() {
[[ -L "${COMPAT_VIRTUALENV_PATH}" ]] && rm "${COMPAT_VIRTUALENV_PATH}"
[ -z "${PREFIX_EXISTS}" ] && rm -rf "$VIRTUALENV_PATH"
}
trap cleanup SIGINT
trap cleanup SIGINT ERR
# Invoke virtualenv and record exit status in $STATUS.
STATUS=0