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

Add a "dump" output option to git-list

It prints a list of all repos URL and is supposed to be consumed by `git get --dump` option.
This commit is contained in:
Grzegorz Dlugoszewski
2020-06-18 11:05:39 +02:00
parent edf60064a8
commit da8f0931d0
4 changed files with 50 additions and 12 deletions

View File

@@ -23,13 +23,13 @@ var cmd = &cobra.Command{
func init() {
cmd.PersistentFlags().StringP(cfg.KeyReposRoot, "r", "", "repos root")
cmd.PersistentFlags().StringP(cfg.KeyPrivateKey, "p", "", "SSH private key path")
cmd.PersistentFlags().StringP(cfg.KeyBundle, "u", "", "Bundle file path")
cmd.PersistentFlags().StringP(cfg.KeyDump, "d", "", "Dump file path")
cmd.PersistentFlags().StringP(cfg.KeyBranch, "b", cfg.DefBranch, "Branch (or tag) to checkout after cloning")
viper.BindPFlag(cfg.KeyReposRoot, cmd.PersistentFlags().Lookup(cfg.KeyReposRoot))
viper.BindPFlag(cfg.KeyPrivateKey, cmd.PersistentFlags().Lookup(cfg.KeyReposRoot))
viper.BindPFlag(cfg.KeyBundle, cmd.PersistentFlags().Lookup(cfg.KeyBundle))
viper.BindPFlag(cfg.KeyDump, cmd.PersistentFlags().Lookup(cfg.KeyDump))
viper.BindPFlag(cfg.KeyBranch, cmd.PersistentFlags().Lookup(cfg.KeyBranch))
}
@@ -38,7 +38,7 @@ func Run(cmd *cobra.Command, args []string) {
root := viper.GetString(cfg.KeyReposRoot)
if bundle := viper.GetString(cfg.KeyBundle); bundle != "" {
if bundle := viper.GetString(cfg.KeyDump); bundle != "" {
opts, err := path.ParseBundleFile(bundle)
exitIfError(err)