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 5 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.

@Stratus3D
Copy link
Member

Hi @bsalesc, Sorry for the late review here. I'm in the process preparing to release a new Go version of asdf. I don't think it makes sense to accept contributions for the Bash code as it will soon be replaced by the new Go code. The asdf global and asdf local commands have also been replaced by an asdf set command in the new code. I'm also not sure that we want to support setting an in-exact version.

@RobLoach
Copy link

@Stratus3D Thanks for the updates... Haven't been in the loop lately with the Go rewrite. There is some infrastructure that I have that won't be able to run Go executables. Is the intent to completely move to Go, and port everything away from bash/zsh/fsh?

I'm sure this question has been asked before. Where's the best place I can help out? Just the issue queue?

@Stratus3D
Copy link
Member

Stratus3D commented Jan 24, 2025

Hi @RobLoach , yes, this issue tracker is the best place to raise issues about both the current version (old Bash implementation) and the new Go version. We'll still have some completion code in bash/zsh/fish for good UX, but the core will be 100% Go.

What infra do you have that cannot run Go binaries?

@RobLoach
Copy link

What infra do you have that cannot run Go binaries?

Super old legacy hardware that will never receive any software updates. No problem though, I'll just keep that to use an older version of asdf.

@Stratus3D
Copy link
Member

What infra do you have that cannot run Go binaries?

Super old legacy hardware that will never receive any software updates. No problem though, I'll just keep that to use an older version of asdf.

I'm sorry to hear that we won't be able to support your older hardware. I was hoping Go would cover 99% of our users. You can certainly continue to use the current version.

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
3 participants