Add command line flag that prevents `asdf install` from ascending to parent directories
matthewadams opened this issue · 0 comments
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:
asdf install --parent-recursion -1
is the same asasdf install
and goes all the way up the tree.asdf install --parent-recursion 0
causes no recursion up the directory tree, only installing what's in./.tool-versions
.asdf install --parent-recursion 1
causesasdf install
to only install what's in.tool-versions
in.
&..
.asdf install --parent-recursion 2
causesasdf install
to only install what's in.tool-versions
in.
,..
, &../..
.asdf install --parent-recursion 1000000
, when run by an idiot where there are fewer than 100000 parent directories would be the same asasdf install --parent-recursion -1
.
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.