Open Lehmanator opened 18 hours ago
Hi Sam,
I‘m fine with a PR.
It should just work, regardless where the config file lies. If a config file is at both places it should result in an error. The caching can be moved according to the XDG spec and the old cache should be deleted.
Greetings, Daniel
The configuration is currently loaded from the file at the path:
~/.rusty-tags/config.toml
, which doesn't comply with the XDG Base Directories specification.Concise explanation of the spec & its benefits
Official Specification
On Linux, a compliant program would read the configuration directory base path from the environment variable
$XDG_CONFIG_HOME
, which is set to the directory~/.config
by default. So the new default config path would be:~/.config/rusty-tags/config.toml
.This program uses the
dirs
crate, which makes it easy to support the spec, using the appropriate directories across platforms.Currently, there is a call to
dirs::home_dir()
, which can be replaced with a call todirs::config_dir()
to get the XDG spec compliant base directory.Not sure how much fallback to the existing config path would be desired or if the program also uses the
~/.rusty-tags
directory for things other than config (like cache & data) that would also need to be moved to comply with the spec.I can make a PR to implement this if necessary.