chore: add one-time index html repair script
This commit is contained in:
parent
6b8a1a604e
commit
6b422deb6a
16
scripts/fix-index-html-once.mjs
Normal file
16
scripts/fix-index-html-once.mjs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
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');
|
||||||
Loading…
Reference in New Issue
Block a user