diff options
| author | Paul Buetow <paul@buetow.org> | 2025-06-12 20:41:19 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-06-12 20:41:19 +0300 |
| commit | c9ae38674e91eeddf9f26fc64d4ddd3a3a3fbbfe (patch) | |
| tree | f2a57f2d2c20f2ac3ee328cf5118793f578a809c /internal/run.go | |
| parent | 93bf6d9b7c07ceba3f968dedbfcee5833917ea46 (diff) | |
add pause feature for social media posting
- Add PauseStart and PauseEnd configuration fields
- Implement IsPaused() method to check pause status
- Skip all posting when current date is within pause period
- Add comprehensive unit tests for pause functionality
- Update README with pause feature documentation and examples
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'internal/run.go')
| -rw-r--r-- | internal/run.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/run.go b/internal/run.go index 016d336..34874fc 100644 --- a/internal/run.go +++ b/internal/run.go @@ -22,6 +22,16 @@ func run(ctx context.Context, args config.Args) error { now := time.Now().Unix() printLogo() + // Check if posting is paused + paused, err := args.Config.IsPaused() + if err != nil { + return fmt.Errorf("error checking pause status: %w", err) + } + if paused { + colour.Infoln("Posting is paused until", args.Config.PauseEnd, "- skipping all posts") + return nil + } + if args.ComposeMode { entryPath := fmt.Sprintf("%s/%d.ask.txt", args.GosDir, now) if err := prompt.EditFile(entryPath); err != nil { |
