refactor: migrate list command to struct API
This commit is contained in:
		| @@ -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 | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user