Closed SVendittelli closed 1 month ago
Thanks for the detailed report. To be honest, I didn't put a ton of thought into the directory locations, I just pulled in dirs
and ran with it. I'm happy to make this change. I have no problem moving the log files without considering it a breaking change, because I don't think anyone has any level of automation or workflows built off the log files. In fact this is the first time anyone other than me has acknowledged their existence.
For the config change, to keep it backward compatible we can just continue to check the old location, but suggest the new location in documentation/command output.
That all sounds great to me, thanks for considering it.
Problem
On Linux, the database, log, and config files are all being stored in
$XDG_DATA_HOME
which doesn't follow the XDG Base Directory Specification.Proposed solution
There is no issue with any of these files being stored in a
slumber
subdirectory of the following proposed locations.The database file (
state.sqlite
) should be stored in thedirs::data_dir
, as it currently is, no change needed.The config file (
config.yml
) should be stored indirs::config_dir
. This points to the same location on macOS and Windows, so would be backwards compatible for those platforms, but would be different for Linux (i.e.$XDG_CONFIG_HOME
not$XDG_DATA_HOME
). This would be a breaking change.The log file (
slumber.log
) is more tricky. According to the spec, this should be stored in$XDG_STATE_HOME
on Linux, provided bydirs::state_dir
. However, this does not have Windows and macOS equivalents in thedirs
crate. For Windows and macOS, thedirs::cache_dir
would be an acceptable fallback. This would be a breaking change.Additional context
dirs
crate