hedgedoc / cli

A tiny CLI for HedgeDoc
GNU Affero General Public License v3.0
150 stars 37 forks source link

Use XDG directory structure #16

Closed SISheogorath closed 5 years ago

SISheogorath commented 5 years ago

While the current CLI already uses the XDG default directories, it fails to implement non-standard locations for those directories.

This patch implements and XDG standards compliant version of the configuration structure.

pirate commented 5 years ago

https://superuser.com/questions/1170793/why-is-local-share-a-two-level-directory https://news.ycombinator.com/item?id=4331969 https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://unix.stackexchange.com/questions/316765/which-distributions-have-home-local-bin-in-path https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Went down quite the rabbit hole researching this. I have to say I'm personally not a fan of the XDG_DIR standard, it seems like it adds fairly arbitrary subfolders for little benefit other than decluttering the home directory... but I guess it is the standard so there's no point in fighting it.

SISheogorath commented 5 years ago

Well, it's not more or less than we do right now, just that we add the ability to redirect things by setting XDG_CONFIG_HOME. The other directories (.cache and .share) are currently unused, so I would be fine with removing them, if you prefer that.

pirate commented 5 years ago

Oh I know, I'm just griping with the standard in general, I'm still happy to merge this PR. But yeah, if we aren't using those other directories, might as well remove them until we need them.

SISheogorath commented 5 years ago

Done :+1:

By the way, are you in the Matrix channel? If you, what's your handle? :D