feat: allowing find the closest version if the exact version is not found #1767
+38
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This is a way to allow you find the closest version in a non semantic way, if plugins are using semantic version is makes even easier.
I was going to open a feature request but there seem to be one opened here #352.
This makes easier for users that have the below cases:
In which I could
asdf global python 2
and as I've2.7.18
installed and it's the only one that starts with 2, then that's the version that will be used, if I want 3, I need to be more specific,asdf global python 3.1
,asdf global python 3.2.0
orasdf global python 3.2.1
. Otherwise it'll fallback and complain sayingversion {VERSION} is not installed for {PLUGIN}
.Fixes: #352
Other Information
I've added tests for the "when is not found a single version" and "when it's found the closest version", let me know if there is need to have more tests.