pinpox / base16-universal-manager

A universal manager to set base16 themes for any supported application
https://github.com/chriskempson/base16
MIT License
89 stars 20 forks source link

Rework path handling #19

Closed cjayross closed 4 years ago

cjayross commented 4 years ago

So I've added my intended cache directories in my config.yaml as

SchemesListFile: "~/.cache/base16/schemeslist.yaml"
TemplatesListFile: "~/.cache/base16/templateslist.yaml"
SchemesCachePath: "~/.cache/base16/schemes/"
TemplatesCachePath: "~/.cache/base16/templates/"

Yet, when I run base16-universal-manager, it turns out that a literal directory \~ is created in my current working directory instead of it referring to $HOME (which doesn't work either when used in the path strings above). Funny enough, I then replaced ~ in the config with the full, absolute path starting with /home, and even then a literal directory home was created as well!

Additionally, it shouldn't be necessary for the user to supply their own caches in the first place. It would be better if you only had a single, dedicated cache directory that would by default be something like $HOME/.cache/base16/ and have this directory applied to everything listed in the snippet above. From there, you could then allow the user to specify a new cache directory in config.yaml if they need it.

Also, speaking of config.yaml, you should also have a dedicated, default location for it in something like $HOME/.config/base16/ rather than require the user to specify a custom location each time in the program's invocation. (I know you can set an alias, but that's not fair for you to require this when it could easily be resolved with good defaults).

pinpox commented 4 years ago

Good points, looking into it. In case you want to help, I'm also open for PRs ;)