-
Notifications
You must be signed in to change notification settings - Fork 778
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
asdf install
should install even when missing a plugin listed in .tool-versions
#1254
Comments
Looks like there is some related discussion here: |
In the end I hacked together a wrapper function to install packages idempotently. I was astonished that it didn't work automatically, I even thought about giving up on the project because it seemed like such a misstep..
|
We have had many discussions about installing plugins automatically in other issues, I would suggest searching and reading those to understand the reasons. And it would be more productive if we discussed and tried to resolve your initial issue without trying to solve the automated plugin problem. @odinhb With your initial issue, if the plugin isn't present to tell the core what legacy files need to be checked, then it cannot resolve which plugins are missing for legacy files. You need the plugin first. It doesn't know to look at Perhaps the behaviour of Since legacy version files support partial semver values, like nodejs I am just brainstorming. @Stratus3D what do you think of this suggestion? Note, the conversation here I believe should be around whether we update the behaviour of |
I was looking for the same functionality. This stop gap one-liner worked for me, leaving it here in case it helps others: awk '{ system("asdf plugin-add " $1) }' < .tool-versions Running FTR: cat .tool-versions
direnv 2.32.3
elixir 1.14.5
erlang 25.3.2.7
golang 1.20.12
nodejs 20.10.0
yarn 1.22.19
postgres 15.3
flyctl 0.1.134 |
Hey, everybody! So I'll just leave this idea here: |
Is your feature request related to a problem? Please describe
I experienced a problem where the order of installation of two plugins matters. In trying to reproduce this problem, by repeatedly adding/removing plugins and installing again, I noticed that because we are using
legacy_version_file = yes
in our~/.asdfrc
,$ asdf install
does not error out if you are missing a plugin whose version is defined in a legacy version file.example environment:
(the
.ruby-version
file being the legacy file forasdf-ruby
)If I fail to install any of the plugins in
.tool-versions
:But if I fail to install the ruby plugin:
I expected the behavior to be consistent in these two scenarios.
Describe the proposed solution
Looks like asdf checks for missing plugins here:
asdf/lib/functions/installs.bash
Lines 93 to 107 in b94ac1d
So that code may be extended to look for legacy version files?
However, I write this as a feature request because, while debugging my problems with asdf bundler I found it very convenient for asdf to skip installing when I was missing plugins. I could simply type
$ asdf install
when I was done adding (or re-adding) plugins.Some of my coworkers would also rather use
gem install
than asdf to manage theirbundler
version. The current situation is that they need to keep typing$ asdf install <plugin-name>
for every plugin, which is pretty annoying.With this in mind, I to propose that
$ asdf install
should be more lenient and stop requiring every plugin to be installed. Perhaps we could print a warning to alert you that you are missing a plugin instead of stopping you.It makes a lot of sense to me, at least, to
cd
into a project directory and run$ asdf install
if I know I already have the necessary plugins.Perhaps the
.tool-versions
could be extended to allow us to specify required/optional plugins manually?Describe similar
asdf
features and why they are not sufficientI'm not aware of any similiar features which would solve this.
Describe other workarounds you've considered
I could add a legacy file parser to the
asdf-bundler
and move our version specification out of.tool-versions
in order to make it an optional tool for my coworkers.The text was updated successfully, but these errors were encountered: