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

Implement primary configuration using XDG conventions. #131

Conversation

realistschuckle
Copy link
Contributor

@realistschuckle realistschuckle commented Mar 25, 2024

Moved direct use of viper to its own package app/config. Now, it provides a layer of abstraction between the application's configuration management and the tech/location behind it.

Functionality

  • Primary location for config is $XDG_CONFIG_HOME/galvanize/config.yaml
  • Secondary location for config is $XDG_HOME/.glearn-config.yaml
  • Creates primary location when primary and secondary locations do not exist
  • Uses primary location if found
  • If primary location is not found, then uses secondary location, if found
  • Prints a deprecation warning if using secondary location
  • Adds new '--upgrade' flag to learn set to move ~/.glearn-config.yaml to primary location
  • Short and long help messages now shows location of configuration file

Secondary location deprecation warning and config file location

image

Upgrading config file moves it to new location

image

Primary and secondary locations both exist

(Notice path in help descriptions showing it is using primary location)

image

Run without primary and secondary locations creates primary location

image

Setting token value and upgrading at the same time works

image

* Primary location for config is $XDG_CONFIG_HOME/galvanize/config.yaml
* Will use the ~/.glearn-config.yaml file if found
* Prints a deprecation warning for using ~/.glearn-config.yaml
* Adds new '--upgrade' flag to `learn set` to move ~/.glearn-config.yaml to primary location
* Short and long help messages now shows location of configuration file
@realistschuckle realistschuckle closed this by deleting the head repository Oct 19, 2024
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.

2 participants