1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 22:33:52 -05:00

Use read -a to split output into an array (#1450)

This commit is contained in:
Mislav Marohnić
2022-10-09 14:48:13 +02:00
committed by GitHub
parent 90c0357682
commit 8275e15cb0
8 changed files with 14 additions and 19 deletions

View File

@@ -47,10 +47,9 @@ if [[ ! -x "$RBENV_COMMAND_PATH" && -n "$GEM_HOME" && -x "${GEM_HOME}/bin/${RBEN
RBENV_COMMAND_PATH="${GEM_HOME}/bin/${RBENV_COMMAND}"
fi
OLDIFS="$IFS"
IFS=$'\n' scripts=(`rbenv-hooks which`)
IFS="$OLDIFS"
IFS=$'\n' read -d '' -r -a scripts <<<"$(rbenv-hooks which)" || true
for script in "${scripts[@]}"; do
# shellcheck disable=SC1090
source "$script"
done