1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-14 06:13:53 -05:00

Improve pyenv version, if there is one missing

Display the other available ones still.

Fixes https://github.com/yyuu/pyenv/issues/291
This commit is contained in:
Daniel Hahler
2014-12-11 18:47:09 +01:00
parent d320d74a07
commit 7f88eabd0b
3 changed files with 47 additions and 1 deletions

View File

@@ -21,6 +21,7 @@ version_exists() {
versions=()
OLDIFS="$IFS"
{ IFS=:
any_not_installed=0
for version in ${PYENV_VERSION}; do
if version_exists "$version" || [ "$version" = "system" ]; then
versions=("${versions[@]}" "${version}")
@@ -31,7 +32,7 @@ OLDIFS="$IFS"
versions=("${versions[@]}" "${version#python-}")
else
echo "pyenv: version \`$version' is not installed" >&2
exit 1
any_not_installed=1
fi
done
}
@@ -42,3 +43,7 @@ OLDIFS="$IFS"
echo "${versions[*]}"
}
IFS="$OLDIFS"
if [ "$any_not_installed" = 1 ]; then
exit 1
fi