AI Resource Pro / website / scripts / revert-html-to-markdown.sh
| 1 | #!/bin/bash |
| 2 | |
| 3 | # Revert HTML to Markdown script |
| 4 | # This script reverts all HTML-formatted blog post content back to markdown format |
| 5 | |
| 6 | # Load environment variables |
| 7 | if [ -f .env.local ]; then |
| 8 | export $(grep -v '^#' .env.local | xargs) |
| 9 | echo "Loaded environment variables from .env.local" |
| 10 | else |
| 11 | echo "Warning: .env.local file not found. Make sure environment variables are set." |
| 12 | fi |
| 13 | |
| 14 | # Execute the TypeScript script |
| 15 | echo "Running HTML to Markdown converter..." |
| 16 | npx tsx scripts/revert-html-to-markdown.ts |
| 17 | |
| 18 | # Check the exit status |
| 19 | if [ $? -eq 0 ]; then |
| 20 | echo "✅ HTML to Markdown conversion completed successfully." |
| 21 | else |
| 22 | echo "❌ HTML to Markdown conversion failed." |
| 23 | exit 1 |
| 24 | fi |