Branchwell

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
7if [ -f .env.local ]; then
8 export $(grep -v '^#' .env.local | xargs)
9 echo "Loaded environment variables from .env.local"
10else
11 echo "Warning: .env.local file not found. Make sure environment variables are set."
12fi
13
14# Execute the TypeScript script
15echo "Running HTML to Markdown converter..."
16npx tsx scripts/revert-html-to-markdown.ts
17
18# Check the exit status
19if [ $? -eq 0 ]; then
20 echo "✅ HTML to Markdown conversion completed successfully."
21else
22 echo "❌ HTML to Markdown conversion failed."
23 exit 1
24fi