1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-11 13:03:46 -05:00

Import changes from ruby-build 20140110.1

This commit is contained in:
Yamashita Yuu
2014-01-10 20:05:01 +09:00
parent 461c5bbc2d
commit 07ae0d8e42
3 changed files with 36 additions and 22 deletions

View File

@@ -38,6 +38,24 @@ case "$DEFINITION" in
;;
esac
declare -a before_hooks after_hooks
before_uninstall() {
local hook="$1"
before_hooks["${#before_hooks[@]}"]="$hook"
}
after_uninstall() {
local hook="$1"
after_hooks["${#after_hooks[@]}"]="$hook"
}
OLDIFS="$IFS"
IFS=$'\n' scripts=(`pyenv-hooks uninstall`)
IFS="$OLDIFS"
for script in "${scripts[@]}"; do source "$script"; done
VERSION_NAME="${DEFINITION##*/}"
PREFIX="${PYENV_ROOT}/versions/${VERSION_NAME}"
@@ -54,7 +72,11 @@ if [ -z "$FORCE" ]; then
esac
fi
for hook in "${before_hooks[@]}"; do eval "$hook"; done
if [ -d "$PREFIX" ]; then
rm -rf "$PREFIX"
pyenv rehash
pyenv-rehash
fi
for hook in "${after_hooks[@]}"; do eval "$hook"; done