-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcleanup-md-files.sh
More file actions
executable file
·19 lines (15 loc) · 1.16 KB
/
cleanup-md-files.sh
File metadata and controls
executable file
·19 lines (15 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# Step 1: Remove all .md files in the content/docs directory
echo "Removing .md files..."
find /Users/deba/Documents/developer-hub/content/docs -name "*.md" -type f -delete
# Step 2: Find and replace all references to .md with .mdx in all files
echo "Updating references from .md to .mdx in all files..."
find /Users/deba/Documents/developer-hub/content/docs -type f -name "*.mdx" -exec sed -i '' 's/\.md)/\.mdx)/g' {} \;
find /Users/deba/Documents/developer-hub/content/docs -type f -name "*.mdx" -exec sed -i '' 's/\.md#/\.mdx#/g' {} \;
find /Users/deba/Documents/developer-hub/content/docs -type f -name "*.mdx" -exec sed -i '' 's/\.md"/\.mdx"/g' {} \;
# Step 3: Update any references in other source files
echo "Updating references in source files..."
find /Users/deba/Documents/developer-hub/app -type f -name "*.tsx" -o -name "*.ts" -exec sed -i '' 's/\.md/\.mdx/g' {} \;
find /Users/deba/Documents/developer-hub/lib -type f -name "*.tsx" -o -name "*.ts" -exec sed -i '' 's/\.md/\.mdx/g' {} \;
find /Users/deba/Documents/developer-hub -maxdepth 1 -type f -name "*.ts" -o -name "*.tsx" -exec sed -i '' 's/\.md/\.mdx/g' {} \;
echo "Conversion and cleanup complete!"