Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allowing find the closest version if the exact version is not found #1767

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

bsalesc
Copy link

@bsalesc bsalesc commented Jul 20, 2024

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:

$ asdf list python
  2.7.18
  3.1.5
> 3.2.0
  3.2.1

In which I could asdf global python 2 and as I've 2.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 or asdf global python 3.2.1. Otherwise it'll fallback and complain saying version {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.

@bsalesc bsalesc requested a review from a team as a code owner July 20, 2024 10:15
@bsalesc bsalesc changed the title Allowing find the closest version if the exact version is not found feat: Allowing find the closest version if the exact version is not found Jul 20, 2024
@bsalesc bsalesc changed the title feat: Allowing find the closest version if the exact version is not found feat: allowing find the closest version if the exact version is not found Jul 20, 2024
test/version_commands.bats Outdated Show resolved Hide resolved
@RobLoach
Copy link

This is very handy. Thanks.

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.

Use best-matching version
2 participants