Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect XDG guidelines #212

Open
doron-cohen opened this issue Feb 18, 2022 · 2 comments
Open

Respect XDG guidelines #212

doron-cohen opened this issue Feb 18, 2022 · 2 comments
Assignees
Labels
enhancement Refactor existing code for better performance and quality

Comments

@doron-cohen
Copy link

Hi,

I saw issue #80 is closed and it seems to be done but the functionality doesn't work. Should it? I would like tfswitch to respect XDG env vars. Alternatively, I wish I could set some env vars to tell it where to store the config and binary.

Thanks

@doron-cohen doron-cohen added the enhancement Refactor existing code for better performance and quality label Feb 18, 2022
@EvyBongers
Copy link

Yes please 👍🏻

@yermulnik
Copy link
Collaborator

For when we get to try and implement this feature request: this seems to be a lib with most active development/support — https://github.com/adrg/xdg

Potential use cases that I can envision:

  • .tfswitch.toml
    • User installation
      • XDG_CONFIG_HOME
        • $XDG_CONFIG_HOME/tfswitch/config.toml
        • $XDG_CONFIG_HOME/.tfswitch.toml
        • $HOME/.tfswitch.toml
    • System-wide installation
      • XDG_CONFIG_DIRS
        • $XDG_CONFIG_DIRS/tfswitch/config.toml
        • $XDG_CONFIG_DIRS/.tfswitch.toml
        • ❗ Caveat: since tfswitch defaults to /usr/local/bin it makes sense to search for config file in /usr/local/etc though
  • .terraform.versions/ (directory with downloaded Terraform/OpenTofu binaries)
    • User installation: XDG_DATA_HOME
    • System-wide installation: XDG_DATA_DIRS
  • tfswitch binary path (install.sh script)
    • User install: XDG_BIN_HOME
    • System-wide install: /usr/local/bin (current default set in tfswtich)
    • ❓ Do we at all want to mess with this part that is sort of external to tfswitch's functionality?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Refactor existing code for better performance and quality
Projects
None yet
Development

No branches or pull requests

4 participants