1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-16 23:33:45 -05:00

fixed to read multiple versions from PYENV_VERSION environment variable

This commit is contained in:
Yamashita Yuu
2012-09-07 19:16:42 +09:00
parent 34a4a532b2
commit 13122ca9bf
8 changed files with 69 additions and 42 deletions

View File

@@ -8,19 +8,19 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare
fi
PYENV_VERSION=($@)
versions=($@)
PYENV_VERSION_FILE="${PYENV_ROOT}/version"
if [ -n "$PYENV_VERSION" ]; then
pyenv-version-file-write "$PYENV_VERSION_FILE" "${PYENV_VERSION[@]}"
if [ -n "$versions" ]; then
pyenv-version-file-write "$PYENV_VERSION_FILE" "${versions[@]}"
else
IFS=: PYENV_VERSION=($(
IFS=: versions=($(
pyenv-version-file-read "$PYENV_VERSION_FILE" ||
pyenv-version-file-read "${PYENV_ROOT}/global" ||
pyenv-version-file-read "${PYENV_ROOT}/default" ||
echo system
))
for version in "${PYENV_VERSION[@]}"; do
for version in "${versions[@]}"; do
echo "$version"
done
fi