This commit is contained in:
2025-04-13 17:11:38 +03:00
parent a51a8ab963
commit 3603dc45a4
5 changed files with 73 additions and 64 deletions

14
repo.go
View File

@ -55,7 +55,10 @@ func AddRepoCmd() *cli.Command {
},
},
Action: func(c *cli.Context) error {
utils.ExitIfNotRoot()
err := utils.ExitIfNotRoot()
if err != nil {
return err
}
ctx := c.Context
@ -63,7 +66,7 @@ func AddRepoCmd() *cli.Command {
repoURL := c.String("url")
cfg := config.New()
err := cfg.Load()
err = cfg.Load()
if err != nil {
slog.Error(gotext.Get("Error loading config"), "err", err)
os.Exit(1)
@ -127,13 +130,16 @@ func RemoveRepoCmd() *cli.Command {
},
},
Action: func(c *cli.Context) error {
utils.ExitIfNotRoot()
err := utils.ExitIfNotRoot()
if err != nil {
return err
}
ctx := c.Context
name := c.String("name")
cfg := config.New()
err := cfg.Load()
err = cfg.Load()
if err != nil {
slog.Error(gotext.Get("Error loading config"), "err", err)
os.Exit(1)