Please respect XDG spec for config storage
Closed this issue ยท 2 comments
timkrueger commented
The XDG spec defines where config and cache files should be placed.
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
Instead of writing to $HOME
, the terraform switcher config directory should be $XDG_CONFIG_HOME/tfswitch
. And the correct location for different terraform versions should be $XDG_CACHE_HOME/tfswitch
.
warrensbox commented
I can implement this logic for the next release:
If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
timkrueger commented
@warrensbox Sounds good.
Only $XDG_CONFIG_HOME
or also $XDG_CACHE_HOME
? E.g.:
$XDG_CACHE_HOME/tfswitch/terraform.versions
Currently the different Terraform versions are stored like that on macOS:
โช tree ~/.terraform.versions/
/Users/tim/.terraform.versions/
โโโ RECENT
โโโ terraform_0.11.14
โโโ terraform_0.12.25