asdf-vm / asdf-vm/asdf

Support XDG locations for files (including plugins)

Open
#687 15 comments 45 reactions 0 assignees View on GitHub
proposal
Dominant language
Go
Stars
25.6k
Forks
941
Avg merge
9h 24m
Merged PRs (30d)
3

Description

### Idea

Edit: it seems supporting the XDG spec would satisfy most peoples needs, so renaming to capture this intent.

Currently `asdf-nodejs`, `asdf-ruby` and `asdf-python` among other plugins allow for `$HOME/.default--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 with `ASDF_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:

```shell
default_gem_path() {
local config_path=${ASDF_CONFIG_FILE:-"$HOME/.asdfrc"}
local config_dir=$(dirname "$config_path")
```

in each plugin is enough. (This was proposed in `asdf-ruby` https://github.com/asdf-vm/asdf-ruby/pull/114/files)

### Related

- https://github.com/asdf-vm/asdf-ruby/issues/111
- https://github.com/asdf-vm/asdf-nodejs/issues/152
- https://github.com/asdf-vm/asdf-ruby/pull/114

Contributor guide

Open the contributing guide

Research direction

Start with the .asdfrc location and ASDF_CONFIG_FILE behavior described in the issue, then compare the default_gem_path example with the related asdf-ruby and asdf-nodejs discussions and pull request. Done should mean that the chosen XDG/config-directory behavior is defined for asdf core and plugins, with the affected plugin configuration locations covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.