Skip to content

fix: Make plugin test resolve latest version#2246

Open
maciektr wants to merge 3 commits intoasdf-vm:masterfrom
maciektr:maciektr/fix-2193
Open

fix: Make plugin test resolve latest version#2246
maciektr wants to merge 3 commits intoasdf-vm:masterfrom
maciektr:maciektr/fix-2193

Conversation

@maciektr
Copy link

Summary

If --asdf-tool-version=latest is passed to plugin test, it should resolve the version correctly, instead of passing latest directly.
This change mimics the one of the old bash plugin:

# Use the version passed in if it was set. Otherwise grab the latest
# version from the versions list
if [ -z "$tool_version" ] || [[ "$tool_version" == *"latest"* ]]; then
version="$(latest_command "$plugin_name" "$(sed -e 's#latest##;s#^:##' <<<"$tool_version")")"
if [ -z "$version" ]; then
fail_test "could not get latest version"
fi
else
version="$tool_version"
fi

It also adds a test case to ensure correct behaviour of the changed code.

Fixes: #2193

Other Information

@maciektr maciektr requested a review from a team as a code owner February 24, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: plugin test command --asdf-tool-version latest does not translate this to an actual version

1 participant