const fs = require('fs');
const path = 'd:/برنامج مخازن/index.html';

let html = fs.readFileSync(path, 'utf8');

const injectionTarget = '<script src="manufacture_module.js" defer></script>';
const injectionStr = '<script src="store_contractors_module.js" defer></script>\n    ';

if (!html.includes('store_contractors_module.js')) {
    html = html.replace(injectionTarget, injectionStr + injectionTarget);
    fs.writeFileSync(path, html, 'utf8');
    console.log('Injected store_contractors_module.js successfully');
} else {
    console.log('Already injected');
}
