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

fix: Removed $HOME/ prefix from global filename path #1798

Closed
wants to merge 1 commit into from

Conversation

alyvusal
Copy link

Summary

Fixes:

  1. Fixes issue for ASDF_DEFAULT_TOOL_VERSIONS_FILENAME when location defined outside /home/user folder

Other Information

@alyvusal alyvusal requested a review from a team as a code owner November 14, 2024 06:29
@alyvusal alyvusal force-pushed the fix/global_file_name branch from 1e7fdb1 to e611759 Compare November 14, 2024 06:30
@alyvusal alyvusal changed the title fix: Removed /home/user/ prefix as it prevents to define cusotm locat… fix: Removed $HOME/ prefix as it prevents to define cusotm locat… Nov 14, 2024
@alyvusal alyvusal changed the title fix: Removed $HOME/ prefix as it prevents to define cusotm locat… fix: Removed $HOME/ prefix from global filename path Nov 14, 2024
@Stratus3D
Copy link
Member

Stratus3D commented Dec 16, 2024

Hi @alyvusal thanks for the PR! However, I believe the existing code was correct.

 file_name="$(asdf_tool_versions_filename)"

The function asdf_tool_versions_filename returns the .tool-versions filename. The filename is just the name of the file, not the full path to the file on the file system. A user might customize it to a different filename, but it must always be a filename because asdf climbs up directories on the file system and looks for files matching this filename in every directory on it's way to /. So when we need to come up with the "global" version file we do this:

file="$HOME/$file_name"

Which is correct if the user has set the default tool versions filename setting to a filename.

If there is something here I missed please let me know.

@Stratus3D Stratus3D closed this Dec 16, 2024
@alyvusal
Copy link
Author

My intention here was toremove harcoded location of .tool-versions, my change allows to use custom location.

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

Successfully merging this pull request may close these issues.

2 participants