Skip to content

Commit 84a4d6d

Browse files
authored
fix: unable to resolve latest lts version correctly (#393)
1 parent 615e023 commit 84a4d6d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: lib/utils.sh

+3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ resolve_version() {
152152

153153
if [ "$query" = lts ] || [ "$query" = "lts/*" ]; then
154154
query="${nodejs_codenames[${#nodejs_codenames[@]} - 1]#*:}"
155+
local all_versions
156+
all_versions=$("$ASDF_NODEJS_PLUGIN_DIR/bin/list-all" 2>/dev/null | tr ' ' '\n')
157+
query=$(echo "$all_versions" | grep "^$query\." | tail -n1)
155158
fi
156159

157160
if [ "${ASDF_NODEJS_LEGACY_FILE_DYNAMIC_STRATEGY-}" ]; then

0 commit comments

Comments
 (0)