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

fix iterating through paths that have spaces in them

Fixes #344, #196
This commit is contained in:
Mislav Marohnić
2013-02-24 14:52:50 +01:00
parent 382db59cd0
commit baf7656d2f
8 changed files with 51 additions and 6 deletions

View File

@@ -20,9 +20,11 @@ elif [ "$1" = "--no-sh" ]; then
shift
fi
IFS=: paths=($PATH)
shopt -s nullglob
{ for path in ${PATH//:/$'\n'}; do
{ for path in "${paths[@]}"; do
for command in "${path}/rbenv-"*; do
command="${command##*rbenv-}"
if [ -n "$sh" ]; then

View File

@@ -32,7 +32,8 @@ fi
RBENV_COMMAND_PATH="$(rbenv-which "$RBENV_COMMAND")"
RBENV_BIN_PATH="${RBENV_COMMAND_PATH%/*}"
for script in $(rbenv-hooks exec); do
IFS=$'\n' scripts=(`rbenv-hooks exec`)
for script in "${scripts[@]}"; do
source "$script"
done

View File

@@ -37,9 +37,11 @@ realpath() {
cd "$cwd"
}
IFS=: hook_paths=($RBENV_HOOK_PATH)
shopt -s nullglob
for path in ${RBENV_HOOK_PATH//:/$'\n'}; do
for script in $path/"$RBENV_COMMAND"/*.bash; do
for path in "${hook_paths[@]}"; do
for script in "$path/$RBENV_COMMAND"/*.bash; do
echo $(realpath $script)
done
done

View File

@@ -144,7 +144,8 @@ make_shims ../versions/*/bin/*
cd "$OLDPWD"
# Allow plugins to register shims.
for script in $(rbenv-hooks rehash); do
IFS=$'\n' scripts=(`rbenv-hooks rehash`)
for script in "${scripts[@]}"; do
source "$script"
done

View File

@@ -63,7 +63,8 @@ else
RBENV_COMMAND_PATH="${RBENV_ROOT}/versions/${RBENV_VERSION}/bin/${RBENV_COMMAND}"
fi
for script in $(rbenv-hooks which); do
IFS=$'\n' scripts=(`rbenv-hooks which`)
for script in "${scripts[@]}"; do
source "$script"
done