refactor: migrate repo to struct

This commit is contained in:
2025-01-14 11:49:42 +03:00
parent e827fb8049
commit 91937a1fc5
9 changed files with 273 additions and 152 deletions

View File

@ -44,14 +44,13 @@ var listCmd = &cli.Command{
ctx := c.Context
log := loggerctx.From(ctx)
cfg := config.New()
db := database.New(cfg)
err := db.Init(ctx)
if err != nil {
log.Fatal("Error initialization database").Err(err).Send()
}
err = repos.Pull(ctx, cfg.Repos(ctx))
rs := repos.New(cfg, db)
err = rs.Pull(ctx, cfg.Repos(ctx))
if err != nil {
log.Fatal("Error pulling repositories").Err(err).Send()
}