const fs = require('fs');

try {
    let indexHtml = fs.readFileSync('index.html', 'utf8');
    const timestamp = Date.now();
    indexHtml = indexHtml.replace(/app_final\.js\?v=\d+/g, 'app_final.js?v=' + timestamp);
    indexHtml = indexHtml.replace(/vouchers_returns\.js\?v=\d+/g, 'vouchers_returns.js?v=' + timestamp);
    fs.writeFileSync('index.html', indexHtml, 'utf8');
    console.log('Cache busted successfully.');
} catch (e) {
    console.error(e);
}
