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

Use XDG_STATE_HOME environment variable as a preference above HOME #243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jaapjansma
Copy link

Fix for #195

One can set the environment variable XDG_STATE_HOME
This will take precedence over the HOME environment variable.

@totten
Copy link
Member

totten commented Mar 19, 2025

Thanks for moving this forward, @jaapjansma!

The test-failures seem to be some unrelated issue in master. (I haven't yet figured out a sufficient routine to focus-in on the problem - but will look at it.)

I wonder if you've had a chance to read the definitions from https://specifications.freedesktop.org/basedir-spec/latest/#variables -- there are a few variables, and the choice of vars somewhat subjective (but not completely).

Like here's my impression

  • UpgradeDbCommand::getUpgradeFile() - Sounds like closest fit to XDG_STATE_HOME?
  • Config::getFileName() and CvPlugins - These sound like XDG_CONFIG_HOME might be closer fit?

@jaapjansma
Copy link
Author

I agree with you for following the standard. However using cv on a well used hosting platform as CiviHosting one needs to set two environment variables to get cv working. Because on CiviHosting those environment variables are not set.

So this requires additional documentation and makes the tool probably less user friendly.

@jaapjansma
Copy link
Author

I have updated the PR to reflect the standard of XDG Base Directories

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