17 lines
541 B
JavaScript
17 lines
541 B
JavaScript
import fs from 'node:fs';
|
|
const path='public/index.html';
|
|
let html=fs.readFileSync(path,'utf8');
|
|
const broken='}<style id="sun-composition-v1757">';
|
|
const fixed='}</style><style id="sun-composition-v1757">';
|
|
if(html.includes(fixed)){
|
|
console.log('index.html already fixed');
|
|
process.exit(0);
|
|
}
|
|
if(!html.includes(broken)){
|
|
console.error('Expected malformed style boundary not found');
|
|
process.exit(2);
|
|
}
|
|
html=html.replace(broken,fixed);
|
|
fs.writeFileSync(path,html);
|
|
console.log('Fixed missing </style> before sun-composition-v1757');
|