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

chore: use XDG base dir or platform dirs for config files. Fixes #483. #736

Merged
merged 3 commits into from
Jul 20, 2023

Conversation

watersb
Copy link
Contributor

@watersb watersb commented Jun 9, 2023

This patch add some options for the location of user configuration directories.

As before, use $HOME/.colima if it already exists.

Otherwise, if the environment variable XDG_CONFIG_HOME is set, the Colima configuration directory should be (shell syntax) "${XDG_CONFIG_HOME}"/colima.

Likewise, if XDG_CACHE_HOME is set, then the cache should be in "${XDG_CACHE_HOME}"/colima.

If these variables are not set, use the Go standard lib os.UserConfigDir() for the configuration:

  • macOS $HOME/Library/Application Support/colima
  • Linux $HOME/.config/colima
  • Windows %AppData%\colima

and uses os.UserCacheDir() for the cache:

  • macOS $HOME/Library/Caches/colima
  • Linux $HOME/.cache/colima
  • Windows %LocalAppData%\colima

This patch addresses #483, and possibly helps #724.

@abiosoft
Copy link
Owner

Thanks for this :)

@abiosoft abiosoft changed the title (revised) Fix #483 - Use XDG Base Dir or platform dirs for config files chore: use XDG base dir or platform dirs for config files. Fixes #483. Jul 20, 2023
@abiosoft abiosoft merged commit b3df079 into abiosoft:main Jul 20, 2023
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