Merge pull request #1364 from alexandergill/fix-install-script

Fix `bash: line 105: v1[$i]: unbound variable` in install script
This commit is contained in:
liv 2023-02-12 15:42:49 +01:00 committed by GitHub
commit 890d6549de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ function vercomp() {
done done
fi fi
for i in `seq 0 $max_len` for i in `seq 0 $((max_len-1))`
do do
# Fill empty fields with zeros in v1 # Fill empty fields with zeros in v1
if [ -z "${v1[$i]}" ] if [ -z "${v1[$i]}" ]
@ -124,7 +124,7 @@ function vercomp() {
} }
RustVersion=$(rustc --version | cut -d " " -f 2) RustVersion=$(rustc --version | cut -d " " -f 2)
MinRustVersion=1.56 MinRustVersion=1.58
vercomp "$RustVersion" $MinRustVersion || ec=$? vercomp "$RustVersion" $MinRustVersion || ec=$?
if [ ${ec:-0} -eq 2 ] if [ ${ec:-0} -eq 2 ]
then then