From c9ae38674e91eeddf9f26fc64d4ddd3a3a3fbbfe Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Jun 2025 20:41:19 +0300 Subject: add pause feature for social media posting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- internal/run.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/run.go') 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 { -- cgit v1.2.3