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

Improve support for basic interpolation config.json #470

Closed
wants to merge 0 commits into from

Conversation

codesections
Copy link

@codesections codesections commented Sep 30, 2022

The "StoreDir" and "TempDir" previously allowed for limited interpolation (limited to $*HOME and $*TMPDIR). This commit adds interpolation of $*XDG_DATA_HOME, $*XDG_CONFIG_HOME, and $*XDG_STATE_HOME with default values from the XDG spec.

It also extends the interpolation for the same values to "DefaultCUR", which also specifies a path.

(My use case for this PR is related to packaging Zef in an environment where Zef is installed system-wide but should use a DefaultCUR that's local to $USER – ideally, a subdirectory of $XDG_DATA_HOME)

@ugexe
Copy link
Owner

ugexe commented Oct 1, 2022

For all zef CLI and config options I want to have a corresponding ENV var, so ideally the DefaultCUR scenario would be replaced with something like setting ZEF_CONFIG_DEFAULTCUR and adding in Zef::CLI wherever $CONFIG<DefaultCUR> is used.

@ugexe
Copy link
Owner

ugexe commented Oct 9, 2022

I opened a PR that adds env variable options for setting these -- #472 -- which should allow you to do what you want in the immediate future (although it does required a second zef-specific env variable to be defined).

I'm still on the fence in regards to interpolating e.g. $*XDG_DATA_HOME because it don't actually exist. That would mean users not super familiar with raku (for instance os packagers) can't intuitively do raku -e 'say $*XDG_DATA_HOME' like they can with e.g. $*HOME. However I do agree improved integration with the xdg directory spec is a good thing.

@2colours
Copy link

2colours commented Nov 6, 2022

@codesections do you think this PR turned unnecessary with ugexe's modifications? If so, I think it would be nice to close it to keep a clean (and transparent) sheet. If not, well, it needs to be updated... :)

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.

None yet

3 participants