sorin
sorin

Reputation: 170410

How to tell asdf to select the second version of nodejs from inside .tools-versions

I am trying to temporary switch the node version to the second version lists in .tool-versions file, but I was not able to find any options for this.

$ cat .tool-versions
nodejs 18.19.1 20.11.1

This is problematic because I have a CI pipeline that is supposed to run using the alternative version, and the exact version is mentioned only in .tool-versions.

Running asdf list nodejs returns all available versions, so it might include other version not listed in .tool-versions and I do not want to accidentally use these.

Upvotes: 0

Views: 105

Answers (1)

hyperupcall
hyperupcall

Reputation: 973

This currently isn't possible. Version selection is handled by select_version(); it iterates through each possible version (for the particular plugin), and selects only the first valid version. It is not possible to select a different version based on a particular condition.

If you want a different version to run in CI, I would recommend modifying the .tool-versions file in CI or choosing a different version management system.

Upvotes: 0

Related Questions