diff --git a/README.md b/README.md index 5bf5ae2..07818d6 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ This app will support the following subcommands: - mg pull - mg fetch - mg register +- mg unregister Passing the `-jX` argument will spin up X jobs simultaneously @@ -18,12 +19,14 @@ mg supports loading an existing ~/.mrconfig and migrating it to ~/.config/mg.con ## Improvements over mr: -1. No external dependencies (except for git) +1. No external dependencies (even git!*) 1. More output options (summary of failures) 1. More deterministic behavior (global vs local run) 1. Exports public functions and can be embedded into other Go programs idiomatically ## Why to stick with mr: -1. If you need support for non-git repos +1. If you need support for non-git VCS tooling 1. If you want to use the [mr plugin ecosystem](https://myrepos.branchable.com/#:~:text=repos%20to%20myrepos-,related%20software,-garden%3A%20manage%20git) + +*: custom-registered commands may rely on external applications. diff --git a/parse/myrepos.go b/parse/myrepos.go index fa23fc2..959be0d 100644 --- a/parse/myrepos.go +++ b/parse/myrepos.go @@ -10,13 +10,13 @@ import ( ) type MRConfig struct { - Unregister string - GC string - Repos []Repo + Repos []Repo + Aliases map[string]string } type Repo struct { Path string Checkout string + Aliases map[string]string } func (m MRConfig) GetRepoPaths() []string { @@ -82,12 +82,15 @@ func LoadMRConfig() (MRConfig, error) { return MRConfig{}, fmt.Errorf("unexpected argument on line %d: %s", n, line) } config.Repos[length].Checkout = split[1] + case "default": + + // TODO load text into Aliases map instead of hardcoded Unregister prop switch split[0] { case "unregister": - config.Unregister = split[1] + config.Aliases["unregister"] = split[1] case "git_gc": - config.GC = split[1] + config.Aliases["gc"] = split[1] default: return MRConfig{}, fmt.Errorf("unexpected argument on line %d: %s", n, line) }