summaryrefslogtreecommitdiff
path: root/internal/cli/sync_handlers.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-11 18:35:25 +0200
committerPaul Buetow <paul@buetow.org>2026-03-11 18:35:25 +0200
commit8e3b69cdface52a755ee64003832557e8b15e23b (patch)
tree3e704f2b400badfd91f007f6601dac423f05f80f /internal/cli/sync_handlers.go
parent9570df7b5426b50c4256d0804cc8a30b14d77039 (diff)
fix(cli): return handler errors consistently
Diffstat (limited to 'internal/cli/sync_handlers.go')
-rw-r--r--internal/cli/sync_handlers.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/cli/sync_handlers.go b/internal/cli/sync_handlers.go
index 2c67518..538e18c 100644
--- a/internal/cli/sync_handlers.go
+++ b/internal/cli/sync_handlers.go
@@ -2,7 +2,6 @@ package cli
import (
"fmt"
- "log"
"math/rand"
"strings"
@@ -59,7 +58,7 @@ func HandleSync(cfg *config.Config, flags *Flags) int {
syncer := sync.New(cfg, flags.WorkDir)
syncer.SetBackupEnabled(flags.Backup)
if err := syncer.SyncRepository(flags.SyncRepo); err != nil {
- log.Fatal("Sync failed:", err)
+ fmt.Printf("ERROR: Sync failed: %v\n", err)
return 1
}
@@ -236,7 +235,8 @@ func HandleSyncCodebergPublic(cfg *config.Config, flags *Flags) int {
fmt.Println("Trying as user account...")
repos, err = client.ListUserPublicRepos()
if err != nil {
- log.Fatal("Failed to fetch repositories:", err)
+ fmt.Printf("ERROR: Failed to fetch repositories: %v\n", err)
+ return 1
}
}
@@ -308,7 +308,8 @@ func HandleSyncGitHubPublic(cfg *config.Config, flags *Flags) int {
repos, err := client.ListPublicRepos()
if err != nil {
- log.Fatal("Failed to fetch repositories:", err)
+ fmt.Printf("ERROR: Failed to fetch repositories: %v\n", err)
+ return 1
}
repoNames := github.GetRepoNames(repos)