1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

Import recent changes from rbenv 0.4.0

This commit is contained in:
Yamashita Yuu
2014-01-02 22:26:22 +09:00
parent 8fa6b4a184
commit 8ddf8760d5
11 changed files with 74 additions and 41 deletions

View File

@@ -19,13 +19,18 @@ if [ -z "$PYENV_COMMAND" ]; then
exit 1
fi
READLINK=$(type -p greadlink readlink | head -1)
if [ -z "$READLINK" ]; then
echo "pyenv: cannot find readlink - are you missing GNU coreutils?" >&2
exit 1
fi
resolve_link() {
$(type -p greadlink readlink | head -1) $1
$READLINK "$1"
}
realpath() {
local cwd="$(pwd)"
local base="$(basename $1)"
local path="$1"
while [ -n "$path" ]; do
@@ -34,13 +39,15 @@ realpath() {
path="$(resolve_link "$name" || true)"
done
echo "$(pwd)/$base"
echo "$(pwd)/$name"
cd "$cwd"
}
IFS=: hook_paths=($PYENV_HOOK_PATH)
shopt -s nullglob
for path in ${PYENV_HOOK_PATH//:/$'\n'}; do
for script in $path/"$PYENV_COMMAND"/*.bash; do
for path in "${hook_paths[@]}"; do
for script in "$path/$PYENV_COMMAND"/*.bash; do
echo $(realpath $script)
done
done