update config module
This commit is contained in:
12
install.go
12
install.go
@ -65,16 +65,22 @@ func InstallCmd() *cli.Command {
|
||||
}
|
||||
|
||||
cfg := config.New()
|
||||
err := cfg.Load()
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error loading config"), "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
db := database.New(cfg)
|
||||
rs := repos.New(cfg, db)
|
||||
err := db.Init(ctx)
|
||||
err = db.Init(ctx)
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error initialization database"), "err", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if cfg.AutoPull(ctx) {
|
||||
err := rs.Pull(ctx, cfg.Repos(ctx))
|
||||
if cfg.AutoPull() {
|
||||
err := rs.Pull(ctx, cfg.Repos())
|
||||
if err != nil {
|
||||
slog.Error(gotext.Get("Error pulling repositories"), "err", err)
|
||||
os.Exit(1)
|
||||
|
Reference in New Issue
Block a user