6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-04 23:14:43 +00:00

Fix problems with loading values from gitconfig

This commit is contained in:
Grzegorz Dlugoszewski
2020-06-30 21:25:42 +02:00
parent aee6d8209b
commit d964158bf7
5 changed files with 31 additions and 37 deletions

View File

@@ -36,16 +36,18 @@ func init() {
viper.BindPFlag(cfg.KeyDefaultHost, cmd.PersistentFlags().Lookup(cfg.KeyDefaultHost))
viper.BindPFlag(cfg.KeyDump, cmd.PersistentFlags().Lookup(cfg.KeyDump))
viper.BindPFlag(cfg.KeyReposRoot, cmd.PersistentFlags().Lookup(cfg.KeyReposRoot))
cfg.Init(&git.ConfigGlobal{})
}
func run(cmd *cobra.Command, args []string) error {
cfg.Init(&git.ConfigGlobal{})
var url string
if len(args) > 0 {
url = args[0]
}
cfg.Expand(cfg.KeyReposRoot)
config := &pkg.GetCfg{
Branch: viper.GetString(cfg.KeyBranch),
DefHost: viper.GetString(cfg.KeyDefaultHost),