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

Moves config for new users into a .config folder per #33 #71

Merged
merged 10 commits into from
Aug 17, 2021

Conversation

lleadbet
Copy link
Contributor

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem/Feature

Per feedback in #33, this PR moves new installation's configurations to a .config subdirectory; existing users are unaffected.

Description of Changes:

  • Defaults the path to $HOME/.config/.twitch-cli

Checklist

  • My code follows the Contribution Guide
  • I have self-reviewed the changes being requested
  • I have made comments on pieces of code that may be difficult to understand for other editors
  • I have updated the documentation (if applicable)

@lleadbet lleadbet requested review from a team, vpolouchkine and Jameka and removed request for a team July 13, 2021 23:27
@lleadbet lleadbet self-assigned this Jul 13, 2021
internal/util/path.go Outdated Show resolved Hide resolved
Copy link
Contributor

@zneix zneix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job so far, looking forward to have this merged in 👍 I've got a couple things to point out though

  1. I believe that this PR should also take XDG_CONFIG_HOME into account and use it instead of ".config" if the mentioned environment variable exists.
  2. How would this act on Windows? I believe that should use %APPDATA%'s value instead of ".config", since that's the closest equivalent of .config on Windows.

I've recently done similar work with implementing viper respecting XDG standard to a project I collaborate on. Guessing it might be helpful a little, so here it is: https://github.com/Chatterino/api/blob/d6d80e88538bf75af022e487aef6ffb81c0548eb/pkg/config/config.go#L84-L103

@lleadbet lleadbet linked an issue Jul 14, 2021 that may be closed by this pull request
@lleadbet
Copy link
Contributor Author

Good job so far, looking forward to have this merged in 👍 I've got a couple things to point out though

  1. I believe that this PR should also take XDG_CONFIG_HOME into account and use it instead of ".config" if the mentioned environment variable exists.
  2. How would this act on Windows? I believe that should use %APPDATA%'s value instead of ".config", since that's the closest equivalent of .config on Windows.

I've recently done similar work with implementing viper respecting XDG standard to a project I collaborate on. Guessing it might be helpful a little, so here it is: https://github.com/Chatterino/api/blob/d6d80e88538bf75af022e487aef6ffb81c0548eb/pkg/config/config.go#L84-L103

Appreciate it; currently it would just tuck it in a .config folder on Windows; but agree $APPDATA might be a good fit; might use some of that code since it is pretty similar to what we'd like to achieve.

@lleadbet lleadbet merged commit f71e161 into main Aug 17, 2021
@lleadbet lleadbet deleted the enhancement/config-path-issue-33 branch August 17, 2021 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twitch-cli should use standard config directory
4 participants