fix: skip versions when filtering aliases if not available on nodebuild

This commit is contained in:
Augusto Moura 2022-03-16 15:08:18 -03:00
parent f9957f3f25
commit aded55ba04
No known key found for this signature in database
GPG Key ID: 67F85AF470AE27DA

View File

@ -40,7 +40,9 @@ die() {
# Print all alias and correspondent versions in the format "$alias\t$version"
# Also prints versions as a alias of itself. Eg: "v10.0.0\tv10.0.0"
filter_version_candidates() {
local curr_line="" aliases=""
local curr_line= aliases= definitions=
definitions=$(nodebuild_wrapped --definitions | grep -v 16.14.1)
# Skip headers
IFS= read -r curr_line
@ -54,6 +56,11 @@ filter_version_candidates() {
# Lowercase lts codename, `-` if not a lts version
local lts_codename=$(echo "${fields[9]}" | tr '[:upper:]' '[:lower:]')
# If not available in nodebuild skip it
if ! grep -q "^$version$" <<< "$definitions"; then
continue
fi
if [ "$lts_codename" != - ]; then
# No lts read yet, so this must be the more recent
if ! grep -q "^lts:" <<< "$aliases"; then