From 4939e24c90f6ffbac83551a2bd8f1974da61bac2 Mon Sep 17 00:00:00 2001 From: Victor Hugo Borja Date: Tue, 26 Nov 2019 22:21:48 -0600 Subject: [PATCH] Make `asdf plugin test` determine plugin version with `asdf latest` Fixes #541 --- CHANGELOG.md | 5 +++++ lib/commands/plugin-test.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd1b2227..f908b2a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Features +* Make `asdf plugin test` use the new `asdf latest` command. (#541) + + If a plugin version is not given explicitly, we use `asdf latest` to + obtain the version of plugin to install for testing. + * `asdf --version` displays git revision when asdf_dir is a git clone. This will allow better bug reports since people can now include the diff --git a/lib/commands/plugin-test.sh b/lib/commands/plugin-test.sh index 9629a23d..319c41b7 100644 --- a/lib/commands/plugin-test.sh +++ b/lib/commands/plugin-test.sh @@ -101,7 +101,7 @@ plugin_test_command() { if [ -n "$tool_version" ]; then version="$tool_version" else - version=${versions[${#versions[@]} - 1]} + version="$(asdf latest "$plugin_name")" fi if ! (asdf install "$plugin_name" "$version"); then