6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-07 20:29:19 +00:00

Refactor implementations of get and list commands

- Simplify the main functions by moving actual implementation to "pkg" package
- Remove the "path" package and move files into the root "pkg" package
- Replace viper with explicit Cfg structs
This commit is contained in:
Grzegorz Dlugoszewski
2020-06-18 15:44:10 +02:00
parent 8511cd6c97
commit 5a588f22d1
9 changed files with 151 additions and 118 deletions

View File

@@ -60,11 +60,11 @@ type gitconfig struct {
*config.Config
}
// InitConfig initializes viper config registry. Values are looked up in the following order: cli flag, env variable, gitconfig file, default value
// Init initializes viper config registry. Values are looked up in the following order: cli flag, env variable, gitconfig file, default value
// Viper doesn't support gitconfig file format so it can't find missing values there automatically. They need to be specified in setMissingValues func.
//
// Because it reads the cli flags it needs to be called after the cmd.Execute().
func InitConfig() {
func Init() {
viper.SetEnvPrefix(strings.ToUpper(GitgetPrefix))
viper.AutomaticEnv()