This commit is contained in:
2025-04-14 23:35:10 +03:00
parent e3aaa88822
commit 6d5016270f
21 changed files with 449 additions and 349 deletions

View File

@ -20,7 +20,6 @@
package main
import (
"log/slog"
"os"
"path/filepath"
@ -76,7 +75,7 @@ func AddRepoCmd() *cli.Command {
reposSlice := cfg.Repos()
for _, repo := range reposSlice {
if repo.URL == repoURL {
if repo.URL == repoURL || repo.Name == name {
return cliutils.FormatCliExit(gotext.Get("Repo %s already exists", repo.Name), nil)
}
}
@ -154,8 +153,7 @@ func RemoveRepoCmd() *cli.Command {
}
}
if !found {
slog.Error(gotext.Get("Repo does not exist"), "name", name)
os.Exit(1)
return cliutils.FormatCliExit(gotext.Get("Repo \"%s\" does not exist", name), nil)
}
cfg.SetRepos(slices.Delete(reposSlice, index, index+1))