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

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

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

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