mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-11 13:03:46 -05:00
Merge pull request #290 from blueyed/version-handle-missing-better
Improve `pyenv version`, if there is one missing
This commit is contained in:
@@ -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}")
|
||||
@@ -28,7 +29,7 @@ OLDIFS="$IFS"
|
||||
versions=("${versions[@]}" "${version#python-}")
|
||||
else
|
||||
echo "pyenv: version \`$version' is not installed" >&2
|
||||
exit 1
|
||||
any_not_installed=1
|
||||
fi
|
||||
done
|
||||
}
|
||||
@@ -39,3 +40,7 @@ OLDIFS="$IFS"
|
||||
echo "${versions[*]}"
|
||||
}
|
||||
IFS="$OLDIFS"
|
||||
|
||||
if [ "$any_not_installed" = 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user