const fs = require('fs');
|
const path = require('path');
|
|
const filePath = path.join(__dirname, 'Index.vue');
|
|
let content = fs.readFileSync(filePath, 'utf8');
|
|
// Read replacements from external JSON to avoid encoding issues in script
|
const replacements = JSON.parse(fs.readFileSync(path.join(__dirname, 'replacements.json'), 'utf8'));
|
|
for (const [old, newStr] of Object.entries(replacements)) {
|
content = content.split(old).join(newStr);
|
}
|
|
fs.writeFileSync(filePath, content, 'utf8');
|
|
console.log('Fixed ' + Object.keys(replacements).length + ' replacements');
|