You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, DEFAULT_STORE has a default value of ~/.git-stats while CONFIG_PATH has a default value of ~/.git-stats-config.js
I would prefer if git-stats did not put the files in the home directory - I propose using the XDG Base Directory Specification to determine the location defaults. Many modern applications today place their configuration and data files in compliance with this standard, making it easy to backup homogeneous (with respect to their type) data or keep the home directory tidy.
This would mean
.git-stats would default to $XDG_STATE_HOME/git-stats/git-stats.json
.git-stats-config.js would default to $XDG_CONFIG_HOME/git-stats/git-stats-config.js
Per the specification, if the environment variables $XDG_STATE_HOME or $XDG_CONFIG_HOME do not exist, then they default to ~/.local/state and ~/.config respectively
To ensure that the changes are backwards compatible, the code can check if ~/.git-stats or ~/.git-stats-config.js exist. If a particular one does not exist in the home folder, then the new changes take effect for that particular file
The text was updated successfully, but these errors were encountered:
I did a quick implementation of this in my fork, it works but ideally @hyperupcall has the better approach for fallback support if the environment variable is missing or if the directory is missing.
Hello!
Right now,
DEFAULT_STORE
has a default value of~/.git-stats
whileCONFIG_PATH
has a default value of~/.git-stats-config.js
I would prefer if
git-stats
did not put the files in the home directory - I propose using the XDG Base Directory Specification to determine the location defaults. Many modern applications today place their configuration and data files in compliance with this standard, making it easy to backup homogeneous (with respect to their type) data or keep the home directory tidy.This would mean
.git-stats
would default to$XDG_STATE_HOME/git-stats/git-stats.json
.git-stats-config.js
would default to$XDG_CONFIG_HOME/git-stats/git-stats-config.js
Per the specification, if the environment variables
$XDG_STATE_HOME
or$XDG_CONFIG_HOME
do not exist, then they default to~/.local/state
and~/.config
respectivelyTo ensure that the changes are backwards compatible, the code can check if
~/.git-stats
or~/.git-stats-config.js
exist. If a particular one does not exist in the home folder, then the new changes take effect for that particular fileThe text was updated successfully, but these errors were encountered: