From df011ee42b3c2c20bcb84b982c9f42c9c88a2925 Mon Sep 17 00:00:00 2001 From: Snider Date: Sat, 21 Feb 2026 01:58:08 +0000 Subject: [PATCH] feat: support .core/repos.yaml and explicit repo paths - FindRegistry() now checks .core/repos.yaml alongside repos.yaml - Repo.Path field accepts explicit path from YAML for repos outside base_path Co-Authored-By: Virgil --- pkg/repos/registry.go | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkg/repos/registry.go b/pkg/repos/registry.go index 1991bdf..07c7486 100644 --- a/pkg/repos/registry.go +++ b/pkg/repos/registry.go @@ -57,7 +57,7 @@ type Repo struct { Clone *bool `yaml:"clone,omitempty"` // nil = true, false = skip cloning // Computed fields - Path string `yaml:"-"` // Full path to repo directory + Path string `yaml:"path,omitempty"` // Full path to repo directory (optional, defaults to base_path/name) registry *Registry `yaml:"-"` } @@ -83,7 +83,11 @@ func LoadRegistry(m io.Medium, path string) (*Registry, error) { // Set computed fields on each repo for name, repo := range reg.Repos { repo.Name = name - repo.Path = filepath.Join(reg.BasePath, name) + if repo.Path == "" { + repo.Path = filepath.Join(reg.BasePath, name) + } else { + repo.Path = expandPath(repo.Path) + } repo.registry = ® // Apply defaults if not set @@ -106,10 +110,16 @@ func FindRegistry(m io.Medium) (string, error) { } for { + // Check repos.yaml (existing) candidate := filepath.Join(dir, "repos.yaml") if m.Exists(candidate) { return candidate, nil } + // Check .core/repos.yaml (new) + candidate = filepath.Join(dir, ".core", "repos.yaml") + if m.Exists(candidate) { + return candidate, nil + } parent := filepath.Dir(dir) if parent == dir { @@ -125,6 +135,7 @@ func FindRegistry(m io.Medium) (string, error) { } commonPaths := []string{ + filepath.Join(home, "Code", "host-uk", ".core", "repos.yaml"), filepath.Join(home, "Code", "host-uk", "repos.yaml"), filepath.Join(home, ".config", "core", "repos.yaml"), }