forked from Plemya-x/ALR
refactor
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user