This commit is contained in:
2025-04-13 19:39:01 +03:00
parent 587abf7aad
commit f26b72b2a2
10 changed files with 186 additions and 184 deletions

View File

@ -92,6 +92,16 @@ func (b *AppBuilder) WithDB() *AppBuilder {
}
func (b *AppBuilder) WithRepos() *AppBuilder {
b.withRepos(false)
return b
}
func (b *AppBuilder) WithReposForcePull() *AppBuilder {
b.withRepos(true)
return b
}
func (b *AppBuilder) withRepos(forcePull bool) *AppBuilder {
if b.err != nil {
return b
}
@ -105,7 +115,7 @@ func (b *AppBuilder) WithRepos() *AppBuilder {
rs := repos.New(cfg, db)
if cfg.AutoPull() {
if forcePull || cfg.AutoPull() {
if err := rs.Pull(b.ctx, cfg.Repos()); err != nil {
slog.Error(gotext.Get("Error pulling repositories"), "err", err)
b.err = cli.Exit("", 1)