-
Notifications
You must be signed in to change notification settings - Fork 788
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
Support XDG locations for files (including plugins) #687
Comments
The main reason I would want to see this is to be more XDG compliant. For instance, I currently do the following in order to keep my
Ideally the |
I know some existing version managers (like rbenv for Ruby) currently look for |
To be clear, I brought up In regards to |
I agree that we should imitate the behavior of legacy version managers by default. If no ENV variable is set then that should be the default behavior. I do notice that there are a few PR's still open which do adhere to this meanwhile providing an option to override this. This does raise the question: should the core enforce this or leave it up to the plugins to decide on their own? The latter would be more suited. I would also like to see these changes in the plugin. My reason is that I also follow the principles of XDG and have moved most of my configuration to For reference and inspiration, here are a few PR's which propose the ability to move default package files to custom locations. asdf-community/asdf-python#63 (merged) |
Sounds like we're all on the same page; support existing ecosystem defaults with a config var for custom location. Should this be part of the asdf core though? |
I would advocate for making export ASDF_DATA_DIR="${XDG_DATA_HOME:-~./local/share}/asdf"
export ASDF_CONFIG_FILE="${XDG_CONFIG_HOME:-~./config}/asdf/asdfrc" Introducing an export ASDF_CONFIG_DIR="${XDG_CONFIG_HOME}/asdf"
export ASDF_CONFIG_FILE="${ASDF_CONFIG_DIR}/asdfrc"
export ASDF_NODEJS_DEFAULT_PACKAGES="${ASDF_CONFIG_DIR}/nodejs_default_packages" The |
From @brennanfee on #844:
|
Following the XDG spec is important for people taking snapshots / backups of their home directory. By not following the XDG spec, storage can quickly and unexpectedly fill up. While most users know to exclude |
Looking forward to this |
@jthegedus could you update this ticket to be about general XDG compliance as discussed in #201 (that this ticket should be)? I would like to include in the discussion that also directories like I currently use: export ASDF_CONFIG_FILE=${XDG_CONFIG_HOME}/asdf/asdfrc
export ASDF_DATA_DIR=${XDG_DATA_HOME}/asdf
export ASDF_PYTHON_DEFAULT_PACKAGES_FILE=${XDG_CONFIG_HOME}/pip/default-python-packages
export ASDF_NPM_DEFAULT_PACKAGES_FILE=${XDG_CONFIG_HOME}/npm/default-npm-packages
export ASDF_GEM_DEFAULT_PACKAGES_FILE=${XDG_CONFIG_HOME}/gem/default-gems
Yays to less clutter in our home directores! 🥳 |
I also ran into the ASDF_DEFAULT_TOOL_VERSIONS_FILENAME issue talked about in #1248 where I'd been using it to shift my global tool-versions to make it XDG compliant, so I look forward to a fix for that issue at the very least. (everything else ASDF related is currently XDG compliant in my setup) |
To add to this discussion I would like the asdf completions to also be XDG compliant and thus reside under I presume the |
I think they mean $XDG_CONFIG_HOME rather than $XDG_CONFIG. |
I'd like to add that asdf also created the file I tired setting ASDF_DEFAULT_TOOL_VERSIONS_FILENAME however after trying it seems to not work using this to move the top-level Edit. |
please do note that this workaround only works for the global |
Idea
Edit: it seems supporting the XDG spec would satisfy most peoples needs, so renaming to capture this intent.
Currently
asdf-nodejs
,asdf-ruby
andasdf-python
among other plugins allow for$HOME/.default-<tool>-packages
config files. It is clear from the discussions in each plugin that people want to be able to configure the file location.Proposals
Perhaps
asdf
core can provide plugins withASDF_CONFIG
dir that is the directory of.asdfrc
by default?This way, users can configure this, and plugin authors can focus on the default packages filename appropriate for their plugin and install those packages instead of also having to support a diverging set of dirs.
Or perhaps this is too much and simply doing:
in each plugin is enough. (This was proposed in
asdf-ruby
https://github.com/asdf-vm/asdf-ruby/pull/114/files)Related
The text was updated successfully, but these errors were encountered: