QR-master/scripts/remove-draft-notes.js

21 lines
818 B
JavaScript

const fs = require('fs');
const path = require('path');
const filePath = path.join(__dirname, '../src/lib/blog-data.ts');
let content = fs.readFileSync(filePath, 'utf-8');
// Remove the draft note from qr-code-scan-statistics-2026
const draftNotePattern = /<p><em>Note: I'm not browsing live sources[\s\S]*?before publishing.*?replace the placeholder sections below with your numbers \+ citations\.<\/em><\/p>/gm;
const originalLength = content.length;
content = content.replace(draftNotePattern, '');
const newLength = content.length;
fs.writeFileSync(filePath, content, 'utf-8');
if (originalLength > newLength) {
console.log(`✅ Removed draft note from qr-code-scan-statistics-2026 (${originalLength - newLength} bytes deleted)`);
} else {
console.log('⚠️ Draft note not found or already removed');
}