diff --git a/lib/utils.sh b/lib/utils.sh index a390123..c1ff503 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -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