diff options
| author | Paul Buetow <paul@buetow.org> | 2025-07-07 23:25:10 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-07-07 23:25:10 +0300 |
| commit | 4526c8a171dbe40762c116e5b8a404f20131d2b1 (patch) | |
| tree | ea3d544cbad995dabb616f4b6136e6e24a097524 /cmd | |
| parent | 64095a2c8d5a3a72c55d7bd0737c5542a5aeee09 (diff) | |
feat: add comprehensive showcase generation with metadata and images
- Add --showcase flag to generate project showcases using Claude
- Extract repository metadata (languages, commits, LOC, dates, license)
- Support image extraction from README files (local and remote)
- Add caching with --force flag to regenerate
- Add exclude_from_showcase config option
- Add standalone showcase mode (--showcase without sync)
- Sort projects by recent activity (avg age of last 100 commits)
- Output in Gemini Gemtext template format (.gmi.tpl)
- Fix backup location fetching when --backup flag not set
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/gitsyncer/main.go | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/cmd/gitsyncer/main.go b/cmd/gitsyncer/main.go index ddf00e3..9828776 100644 --- a/cmd/gitsyncer/main.go +++ b/cmd/gitsyncer/main.go @@ -1,6 +1,7 @@ package main import ( + "fmt" "os" "path/filepath" @@ -59,25 +60,61 @@ func main() { // Handle sync operation if flags.SyncRepo != "" { - os.Exit(cli.HandleSync(cfg, flags)) + exitCode := cli.HandleSync(cfg, flags) + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + os.Exit(exitCode) } // Handle sync all operation if flags.SyncAll { - os.Exit(cli.HandleSyncAll(cfg, flags)) + exitCode := cli.HandleSyncAll(cfg, flags) + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + os.Exit(exitCode) } // Handle sync Codeberg public repos if flags.SyncCodebergPublic { exitCode := cli.HandleSyncCodebergPublic(cfg, flags) if exitCode != 0 || !flags.SyncGitHubPublic { + if exitCode == 0 && flags.Showcase && !flags.SyncGitHubPublic { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } os.Exit(exitCode) } } // Handle sync GitHub public repos if flags.SyncGitHubPublic { - os.Exit(cli.HandleSyncGitHubPublic(cfg, flags)) + exitCode := cli.HandleSyncGitHubPublic(cfg, flags) + + // Run showcase generation if requested and sync was successful + if exitCode == 0 && flags.Showcase { + showcaseCode := cli.HandleShowcase(cfg, flags) + if showcaseCode != 0 { + os.Exit(showcaseCode) + } + } + + os.Exit(exitCode) + } + + // Handle standalone showcase mode (no sync operations specified) + if flags.Showcase { + fmt.Println("Running showcase generation for all repositories (clone-only mode)...") + os.Exit(cli.HandleShowcaseOnly(cfg, flags)) } // Default: show usage |
