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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user