Fix wrongly defined zsh substitution

This commit is contained in:
ItsDrike 2022-06-02 16:55:08 +02:00
parent 26ae50db18
commit 7e087b1c07
No known key found for this signature in database
GPG key ID: B014E761034AF742

View file

@ -64,8 +64,8 @@ version_compare() {
version_1="$1" version_1="$1"
version_2="$2" version_2="$2"
# ZSH Only: # ZSH Only:
version_1=(${(@s:.:)version_1}) version_1=("${(@s:.:)version_1}")
version_2=(${(@s:.:)version_2}) version_2=("${(@s:.:)version_2}")
major_1=$version_1[1] major_1=$version_1[1]
major_2=$version_2[1] major_2=$version_2[1]
minor_1=$version_1[2] minor_1=$version_1[2]
@ -146,9 +146,9 @@ define_version_aliases() {
# ZSH only: # ZSH only:
version_data=(${(@s:.:)version}) version_data=("${(@s:.:)version}")
major_version=$version_data[0] major_version=$version_data[1]
minor_version=$version_data[1] minor_version=$version_data[2]
# POSIX, but slow: # POSIX, but slow:
# major_version="$(echo "$version" | cut -d. -f1)" # major_version="$(echo "$version" | cut -d. -f1)"
# minor_version="$(echo "$version" | cut -d. -f2)" # minor_version="$(echo "$version" | cut -d. -f2)"
@ -174,10 +174,10 @@ for python_dir in "$PYENV_ROOT"/versions/*/ ; do
fi fi
# ZSH only: # ZSH only:
version_data=(${(@s:;:)version_info}) version_data=("${(@s:;:)version_info}")
prefix=$version_data[0] prefix=$version_data[1]
version=$version_data[1] version=$version_data[2]
suffix=$version_data[2] suffix=$version_data[3]
# POSIX, but slow: # POSIX, but slow:
# prefix="$(echo "$version_info" | cut -d';' -f1)" # prefix="$(echo "$version_info" | cut -d';' -f1)"
# version="$(echo "$version_info" | cut -d';' -f2)" # version="$(echo "$version_info" | cut -d';' -f2)"