Skip to content

Commit

Permalink
Fix versions lower than 5.4 for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
nulty committed Mar 22, 2024
1 parent aa6abfd commit ab38b84
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ get_target() {
elif [ "${ASDF_LUA_LINUX_READLINE-}" == "1" ]; then
echo "linux-readline"
else # Otherwise let the lua Makefile guess for us
echo "guess"
if less_than_version_5_4x "$version"; then
echo "linux"
else
echo "guess"
fi
fi
}

Expand Down Expand Up @@ -150,4 +154,15 @@ version_5_2x_or_greater() {
fi
}

less_than_version_5_4x() {
version=$1
IFS='.' read -ra version_array <<<"$version"
major_minor_version="${version_array[0]}0${version_array[1]}"
if (("$major_minor_version" <= 504)); then
return 0
else
return 1
fi
}

install_lua "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" "$ASDF_DOWNLOAD_PATH"

0 comments on commit ab38b84

Please sign in to comment.