cslarsen / wpm

Typeracer-like console app for measuring your WPM
GNU Affero General Public License v3.0
322 stars 48 forks source link

[WIP] Change default location for config files to platform defined config folder (Close #42) #43

Open cjbassi opened 5 years ago

cjbassi commented 5 years ago

This change makes wpm load and store config files to ~/.config/wpm by default, specifically the wpm.csv and wpmrc files. It also removes the current functionality of loading config files from the home directory, but let me know if I should readd that functionality as a fallback if the ~/.config/wpm/* files don't exist since this would be a breaking change otherwise.

cslarsen commented 5 years ago

The PR itself is fair enough, but does indeed break a lot for existing, casual users (myself included). If I'd merge this, then it would not read my current settings or stats.

I think you need an upgrade strategy in the PR, where you copy the files over. Also, make sure .config exists. I am not too deep into the XDG specs, but if you can help me out understanding how this is useful (and provide an automatic switchover functionality) then I'd merge this PR.

cjbassi commented 5 years ago

Yah, breaking changes should definitely be avoided. I think the best solution would be to readd support for the currently used config file paths in this PR and default to that if the ~/.config/wpm/* files don't exist. So we're just creating a hierarchical lookup for the config file paths, which is a pretty standard cli app feature actually.

Also, the OSX standardization would need to be added to this PR, as mentioned in #42.