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

Support asdf shell latest:version #1649

Open
Birdie0 opened this issue Sep 25, 2023 · 0 comments
Open

Support asdf shell latest:version #1649

Birdie0 opened this issue Sep 25, 2023 · 0 comments

Comments

@Birdie0
Copy link

Birdie0 commented Sep 25, 2023

Is your feature request related to a problem? Please describe

asdf local <version> and asdf global <version> support two formats for version setting: <version> (20.0.0) and latest[:<version>] (latest:20), but asdf shell supports only first one.

It's not quite clear why only one command doesn't support latest: prefix making it a bit inconsistent. When switching between versions and relying on prefix you would expect it to work with all three.

Describe the proposed solution

Add support of asdf shell latest[:<version>] so it will be consistent with other two version set commands.

Describe similar asdf features and why they are not sufficient

asdf local and asdf global modify .tool-version file so they're not much of replacement. Shell completion helps but when relying on shell history it still requires manually editing version (ex. asdf shell nodejs 20.0.0 -> asdf shell nodejs 20.1.0).

Describe other workarounds you've considered

Tried wrapping asdf list-all to resolve latest version, it works but quite slow sometimes:

function asdf-shell-latest() {
	asdf shell "$1" "$(asdf list-all "$1" "$2" | tail -n1)"
}

# sets ruby version to 2.7.8 as latest available
asdf-shell-latest ruby 2.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant