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

@@ -9,9 +9,9 @@ if [ "$1" = "--complete" ]; then
exec pyenv-versions --bare
fi
version="$1"
versions=("$@")
if [ -z "$version" ]; then
if [ -z "$versions" ]; then
if [ -z "$PYENV_VERSION" ]; then
echo "pyenv: no shell-specific version configured" >&2
exit 1
@@ -21,12 +21,13 @@ if [ -z "$version" ]; then
fi
fi
if [ "$version" = "--unset" ]; then
if [ "$versions" = "--unset" ]; then
echo "unset PYENV_VERSION"
exit 1
fi
# Make sure the specified version is installed.
pyenv-prefix $version >/dev/null
pyenv-prefix "${versions[@]}" >/dev/null
echo "export PYENV_VERSION=\"${version}\""
IFS=: PYENV_VERSION="${versions[*]}"
echo "export PYENV_VERSION=\"${PYENV_VERSION}\""