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

When XDG_CONFIG_HOME is defined cointop places the config.toml in $XDG_CONFIG_HOME/.config/cointop #57

Closed
biehlerj opened this issue Aug 7, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@biehlerj
Copy link
Contributor

biehlerj commented Aug 7, 2020

When a user has defined the environment variable XDG_CONFIG_HOME, the expected behavior of programs that use that environment variable is to place their config directory in$XDG_CONFIG_HOME/<name of app>/. On first startup of cointop it does not follow the expected behavior and instead places its config directory in $XDG_CONFIG_HOME/.config/cointop/. This breaks automation scripts that expect the app to properly leverage the environment variable (ex. scripting downloading cointop and placing the color schemes in the cointop config directory).

One way to fix this could be to change defaultConfigFilePath call a function that checks if XDG_CONFIG_HOME is defined and would either return the expanded value of $XDG_CONFIG_HOME/cointop/config.toml or ~/.config/cointop/config.toml if XDG_CONFIG_HOME is not defined.

System Information:

  • Ubuntu 18.04
  • Go version 1.14.4 linux/amd64

Steps to reproduce:

  1. Define the XDG_CONFIG_HOME environment variable in your shell's rc file or $HOME/.profile
  2. Download cointop using go get -u github.com/miguelmota/cointop
  3. Start cointop and run ls -a $XDG_CONFIG_HOME to verify that $XDG_CONFIG_HOME does not contain a cointop directory, but does contain a .config directory with a cointop subdirectory.
@miguelmota miguelmota added the bug Something isn't working label Aug 9, 2020
@biehlerj
Copy link
Contributor Author

PR submitted for fix #58

@miguelmota
Copy link
Member

Closed by #58

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants