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