start work on more mr config, add readme

This commit is contained in:
2023-03-08 17:21:02 -08:00
parent 144d4f6b87
commit 7455da4355
2 changed files with 13 additions and 7 deletions

View File

@@ -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)
}