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

Ability to not error, or ignore error on installing existing version #1865

Open
halkeye opened this issue Jan 31, 2025 · 1 comment
Open

Comments

@halkeye
Copy link

halkeye commented Jan 31, 2025

Is your feature request related to a problem? Please describe

Trying to update my ansible script to the new golang version
I'm getting exit code 1 on a rerun cause the version is already installed

$  asdf install nodejs 21.7.1; echo $?
Trying to update node-build... ok
To follow progress, use 'tail -f /tmp/node-build.20250131120719.1442300.log' or pass --verbose
Downloading node-v21.7.1-linux-x64.tar.gz...
-> https://nodejs.org/dist/v21.7.1/node-v21.7.1-linux-x64.tar.gz

WARNING: node-v21.7.1-linux-x64 is past its end of life and is now unsupported.
It no longer receives bug fixes or security updates.

Installing node-v21.7.1-linux-x64...
Installed node-v21.7.1-linux-x64 to /home/halkeye/.asdf/installs/nodejs/21.7.1

Installing the following default packages globally: yarn, jsonlint, neovim, serve, vim-language-server, bash-language-server, @devcontainers/cli
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.

added 171 packages in 5s

30 packages are looking for funding
  run `npm fund` for details
0

$ asdf install nodejs 21.7.1; echo $?
error installing version: version {version 21.7.1} of nodejs is already installed
1

Describe the proposed solution

Either have https://github.com/asdf-vm/asdf/blob/master/internal/versions/versions.go#L127 be a warning not an error
or add a flag for --ignore-already-installed or something

Describe similar asdf features and why they are not sufficient

n/a

Describe other workarounds you've considered

I can do "|| true" but that'll ignore all errors

@vladlosev
Copy link

We use asdf to install required tools in our CI workflows, and is such automated situation the use of the right exit code to indicate a success of operation is critical. As it is, currently we cannot upgrade to v0.16 for this reason.

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

2 participants