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

Customizable location for .tool-versions #1617

Open
zrusilla opened this issue Aug 11, 2023 · 1 comment
Open

Customizable location for .tool-versions #1617

zrusilla opened this issue Aug 11, 2023 · 1 comment

Comments

@zrusilla
Copy link

zrusilla commented Aug 11, 2023

Is your feature request related to a problem? Please describe

I'd like to be able to explicitly set via the environment where the .tool-versions exists.

My current use case is an automated installation of asdf and plugins to a project workspace, where it should be kept apart from a user's own installation. The .tools-versions gets written and is searched for in $PWD, which means the directory the script is running from.

I would like to ensure it's written to the project space, findable by the installer, as well as by the user if the environment is set correctly. I should be able to see what the installer did with asdf current [plugin].

Describe the proposed solution

I would like location to tool-versions customizable via the environment Some options

  • ASDF_DEFAULT_TOOL_VERSIONS_FILENAME is the full path name
  • .tool-versions is written relative to $ASDF_DIR

I did a small test by replacing $PWD with $(asdf_dir), for example

--- a/lib/commands/command-current.bash
+++ b/lib/commands/command-current.bash
@@ -10,7 +10,7 @@ plugin_current_command() {
   check_if_plugin_exists "$plugin_name"

   local search_path
-  search_path=$PWD
+  search_path=$(asdf_dir)
``

With ASDF_DIR set to my project space, I was able to see the installed plugins with `asdf current`.  This isn't an entirely correct solution since it changes the default location from  where it is currently, but illustrates what I mean.


### Describe similar `asdf` features and why they are not sufficient

ASDF_DEFAULT_TOOL_VERSIONS_FILENAME is only the filename itself.   asdf starts looking for it at $PWD and works its way up the tree.  This may not be correct for the hands-off installation use case.

### Describe other workarounds you've considered

I've fiddled extensively with the environment variable settings
I may need to chdir in my script to get it to write things to the desired locations. 


@hyperupcall
Copy link
Contributor

hyperupcall commented Aug 11, 2023

Related to #1365 and #1553.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants