leDailySquirrel/scripts/publish.sh

16 lines
443 B
Bash
Raw Permalink Normal View History

2026-07-04 19:55:57 +00:00
#!/bin/bash
# Find the file containing the draft
DRAFT_FILE=$(grep -rl "^status: draft" content/editions/ | head -n 1)
if [ -z "$DRAFT_FILE" ]; then
echo "❌ Error: No open drafts found to publish."
exit 1
fi
# Flip the status using sed
sed -i 's/^status: draft/status: published/' "$DRAFT_FILE"
echo "✅ Success! Flipped status to published."
echo "📰 Run 'make build' to generate the archive, then commit and merge to main."