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

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

Open
matthewadams opened this issue Apr 10, 2024 · 0 comments

Comments

@matthewadams
Copy link

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 as asdf 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 causes asdf install to only install what's in .tool-versions in . & ...
  • asdf install --parent-recursion 2 causes asdf 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 as asdf 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.

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

1 participant