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

Support XDG base directory specification #5807

Open
1 task done
danepowell opened this issue Feb 8, 2024 · 4 comments · May be fixed by #5813
Open
1 task done

Support XDG base directory specification #5807

danepowell opened this issue Feb 8, 2024 · 4 comments · May be fixed by #5813

Comments

@danepowell
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem?

I'm frustrated when software such as DDEV doesn't respect the XDG base directory specification, leading to a cluttered home directory fully of one-off config directories like ~/.ddev.

Describe your solution

Follow the XDG base directory spec. For instance, in the absence of any XDG environment variables, move ~/.ddev to ~/.config/ddev. If XDG_CONFIG_HOME is set, move ~/.ddev to $XDG_CONFIG_HOME/ddev.

As a transitional solution (so this doesn't need to be a breaking change), load and use the ~/.ddev directory if it already exists instead of following XDG_CONFIG_HOME.

Note that there are other XDG directories besides the config home; I haven't investigated whether DDEV can or should make use of those.

Describe alternatives

No response

Additional context

No response

@rfay
Copy link
Member

rfay commented Feb 8, 2024

I'd be fine with this if it were supported farther up the chain.

DDEV uses https://pkg.go.dev/os#UserHomeDir to figure out the homedir

While XDG base directory is a super-valid idea, it's really linux-oriented, right? And DDEV is very much for many different environments.

@danepowell
Copy link
Author

It looks like you could (and should) use UserConfigDir instead of UserHomeDir.

@rfay
Copy link
Member

rfay commented Feb 9, 2024

Sounds promising. Interested in doing a PR?

danepowell added a commit to danepowell/ddev that referenced this issue Feb 9, 2024
@danepowell
Copy link
Author

Thanks, I took a crack at a PR: #5813

It just respects XDG_CONFIG_HOME for now. You may want to adopt other parts of XDG in the future, but this is good enough for me.

stasadev pushed a commit to danepowell/ddev that referenced this issue Mar 29, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue Mar 29, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue Apr 10, 2024
stasadev pushed a commit to stasadev/ddev that referenced this issue Apr 19, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue Apr 19, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue Apr 26, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue Apr 26, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue May 1, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue May 2, 2024
stasadev pushed a commit to danepowell/ddev that referenced this issue May 8, 2024
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