refactor: migrate list command to struct API

This commit is contained in:
2025-01-14 10:35:23 +03:00
parent 52d3ab7791
commit a13acc5ed0
2 changed files with 27 additions and 5 deletions

View File

@ -34,6 +34,7 @@ type ALRConfig struct {
cfg *types.Config
paths *Paths
cfgOnce sync.Once
pathsOnce sync.Once
}
@ -126,3 +127,17 @@ func (c *ALRConfig) GetPaths(ctx context.Context) *Paths {
})
return c.paths
}
func (c *ALRConfig) Repos(ctx context.Context) []types.Repo {
c.cfgOnce.Do(func() {
c.Load(ctx)
})
return c.cfg.Repos
}
func (c *ALRConfig) IgnorePkgUpdates(ctx context.Context) []string {
c.cfgOnce.Do(func() {
c.Load(ctx)
})
return c.cfg.IgnorePkgUpdates
}