const fs = require('fs');
let html = fs.readFileSync('index.html', 'utf8');

if (!html.includes('subcontracts.js')) {
    html = html.replace('</body>', '  <script src="subcontracts.js?v=new" defer></script>\n</body>');
    fs.writeFileSync('index.html', html, 'utf8');
    console.log('Injected subcontracts.js into index.html');
} else {
    console.log('subcontracts.js already injected');
}
