feat: add autoPull in config

This commit is contained in:
2025-01-22 18:10:57 +03:00
parent 30f95a4cbf
commit 309ecf784f
9 changed files with 115 additions and 80 deletions

View File

@ -45,6 +45,7 @@ var defaultConfig = &types.Config{
RootCmd: "sudo",
PagerStyle: "native",
IgnorePkgUpdates: []string{},
AutoPull: true,
Repos: []types.Repo{
{
Name: "default",
@ -162,3 +163,10 @@ func (c *ALRConfig) IgnorePkgUpdates(ctx context.Context) []string {
})
return c.cfg.IgnorePkgUpdates
}
func (c *ALRConfig) AutoPull(ctx context.Context) bool {
c.cfgOnce.Do(func() {
c.Load(ctx)
})
return c.cfg.AutoPull
}