Pārlūkot izejas kodu

version-name: skip redundant checks (#3492)

master
native-api pirms 15 stundām
revīziju iesūtīja GitHub
vecāks
revīzija
b3a3e702f1
Šim parakstam datu bāzē netika atrasta zināma atslēga GPG atslēgas ID: B5690EEEBB952194
1 mainītis faili ar 7 papildinājumiem un 5 dzēšanām
  1. +7
    -5
      libexec/pyenv-version-name

+ 7
- 5
libexec/pyenv-version-name Parādīt failu

@ -46,20 +46,22 @@ versions=()
OLDIFS="$IFS"
{ IFS=:
any_not_installed=0
normalization_done=
# Unquoted $VAR does glob expansion (against the current dir's contents) after IFS-splitting
# which is undesired
set -f
for version in ${PYENV_VERSION}; do
# Remove the explicit 'python-' prefix from versions like 'python-3.12'.
normalised_version="${version#python-}"
if version_exists "${version}" || [ "$version" = "system" ]; then
versions+=("${version}")
elif version_exists "${normalised_version}"; then
[[ $version != "${normalised_version}" ]] && normalization_done=1
if [[ $version == "system" ]] || version_exists "${normalised_version}" ; then
versions+=("${normalised_version}")
elif resolved_version="$(pyenv-latest -b "${version}")"; then
versions+=("${resolved_version}")
elif [[ -n $normalization_done ]] && version_exists "${version}"; then
versions+=("${version}")
elif resolved_version="$(pyenv-latest -b "${normalised_version}")"; then
versions+=("${resolved_version}")
elif [[ -n $normalization_done ]] && resolved_version="$(pyenv-latest -b "${version}")"; then
versions+=("${resolved_version}")
else
if [[ -n $FORCE ]]; then
versions+=("${normalised_version}")

Notiek ielāde…
Atcelt
Saglabāt