asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
21.14k stars 763 forks source link

Add command line flag that prevents `asdf install` from ascending to parent directories #1739

Open matthewadams opened 3 months ago

matthewadams commented 3 months ago

Is your feature request related to a problem? Please describe

I'm using asdf to install required tools in different projects (gradle/kts, vuejs, etc), and for those projects, I've added a hook before their respective build files kick in to effectively perform asdf install if asdf is found to be on the path. I noticed that asdf install ascends directories, installing everything found in .tool-versions files all the way up the tree. I want to tell asdf install to install only stuff that is specified in the current directory's .tool-versions file, and not to go up the directory tree, mostly because it's unnecessary and wastes time installing things that aren't relevant to the projects.

Describe the proposed solution

Please add an option --parent-recursion, --recursion, or similar (you pick the name) that defaults to -1, meaning "go all the way up the directory tree" , preserving backward compatibility. However, when given 0, this instructs asdf not to ascend to parent directories, and any other positive number means "only go up this many parent directories".

Use cases:

Describe similar asdf features and why they are not sufficient

I'm not aware of any existing features similar to this.

Describe other workarounds you've considered

I'm not aware of any possible workarounds for this.