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

Address issue 227 by adopting XDG config convention #228

Merged
merged 14 commits into from
May 29, 2022

Conversation

seancorfield
Copy link
Contributor

This addresses #227 by:

  • Changing the default config.edn location to the XDG location (default ~/.config/polylith/config.edn but overridable via the XDG_CONFIG_HOME environment variable).
  • Adding a migration of ~/.polylith/config.edn to the new location, adding a comment in the old file so any projects still using older poly versions can still read it.

Note: I'm not sure how Circle CI will handle environment variable syntax in config.yml but I've tried to make it work regardless of XDG_CONFIG_HOME being set; If that breaks it, just changing to ~/.config/polylith in those four lines should solve it.

By default, that's `~/.config/polylith/config.edn` but the `XDG_CONFIG_HOME`
environment variable can override the `~/.config` part of that path.
Copy the file.
Read the old config, prepend a migration comment, and write it back.
This reverts a potentially breaking change where I calculated `home-dir`
from the `HOME` environment variable.
Now only the config file location uses `HOME` and that's because the XDG
specification explicitly relies on environment variables.
@seancorfield
Copy link
Contributor Author

seancorfield commented May 28, 2022

Apparently, the Circle CI updates were acceptable. The conflicts are cosmetic and seem to reflect a difference due to the pluggable test runner change (which I thought was on master and I thought I was all merged up to date but apparently not -- LMK if you want me to fix the PR). PR updated after full rebasing.

By default, that's `~/.config/polylith/config.edn` but the `XDG_CONFIG_HOME`
environment variable can override the `~/.config` part of that path.
Copy the file.
Read the old config, prepend a migration comment, and write it back.
This reverts a potentially breaking change where I calculated `home-dir`
from the `HOME` environment variable.
Now only the config file location uses `HOME` and that's because the XDG
specification explicitly relies on environment variables.
Copy link
Collaborator

@tengstrand tengstrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Sean!
This looks great to me. I have just tested it on my machine, which is not an XGD system, and it seems to work as before. I will approve this if you update polylith.clj.core.version.interface with the correct issue and date, e.g.:

(def revision "alpha-issue227-01")
(def date "2022-05-29")

I need to update the gitbook documentation also, branch "Release 0.2.15" (that's the downside of letting the documentation live in a separate repo).

@seancorfield
Copy link
Contributor Author

Updates made.

Copy link
Collaborator

@tengstrand tengstrand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@tengstrand tengstrand merged commit 0904efc into polyfy:master May 29, 2022
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