Add command line flag that prevents asdf install
from ascending to parent directories
#1739
Labels
asdf install
from ascending to parent directories
#1739
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
ifasdf
is found to be on the path. I noticed thatasdf install
ascends directories, installing everything found in.tool-versions
files all the way up the tree. I want to tellasdf 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 given0
, 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 sufficientI'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.
The text was updated successfully, but these errors were encountered: