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

recursive upward search #1707

Closed
danielb2 opened this issue Jan 12, 2024 · 2 comments
Closed

recursive upward search #1707

danielb2 opened this issue Jan 12, 2024 · 2 comments

Comments

@danielb2
Copy link

Is your feature request related to a problem? Please describe

I've got a work project and not everyone uses asdf and I don't want to "pollute" the git repo with a .tool-versions. direnv is already used by the project.

Describe the proposed solution

Do recursive upward search to to find the first .tool-version available and use the versions there

Describe similar asdf features and why they are not sufficient

  • $HOME/.tool-versions is too general
  • direnv is already used by the project and I don't want to pollute that file
  • using a local .tool-versions would also pollute the project unless I add to .gitignore. but there are multiple projects and a recursive upward search would make it much easier as I don't have to commit files to work around it

Describe other workarounds you've considered

I could mess with .gitignore for every single project I have. both for work and other projects.

@jthegedus
Copy link
Contributor

$HOME/.tool-versions is not a specific "global" implementation, we already recursively look up directories and typically find $HOME/.tool-versions as most people work within their $HOME dir.

My solution to this exact problem is to put a .tool-versions file in a shared work project directory. Eg:

$HOME
     /dev
         /dotfiles
     /work
         .tool-versions
         /project1
         /project2

so when working in project1 or project2 the $HOME/work/.tool-versions is used.

Other options include .gitignore .tool-versions files from your global settings if it appears under a work directory.


Since this is already how asdf works, and there are solutions to this particular scenario, I am going to close this issue.

@danielb2
Copy link
Author

danielb2 commented Jan 13, 2024

@jthegedus you're right. I'm not sure what I did wrong yesterday. Thank you. I used asdf current yesterday to check too, but somehow I missed it used the one I expected 🤷‍♂️

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

2 participants