const fs = require('fs');

const scripts = [
    'update_app_final2.js',
    'update_pay_client_abstract.js',
    'remove_pct.js',
    'update_taxes.js',
    'update_abstracts_features.js',
    'fix_newlines.js',
    'update_sa_warning.js',
    'fix_comments_visibility.js',
    'fix_save.js',
    'fix_numbering.js',
    'fix_save_render.js',
    'restore_modal.js',
    'fix_app_final.js',
    'fix_actions.js',
    'fix_view.js',
    'add_modal_actions.js',
    'add_client_payments.js',
    'find_remaining.js',
    'update_client_ab_table.js',
    'fix_buttons.js',
    'fix_client_buttons.js'
];

let report = "";
for (let s of scripts) {
    if (fs.existsSync(s)) {
        report += `\n\n--- ${s} ---\n`;
        report += fs.readFileSync(s, 'utf8');
    }
}

fs.writeFileSync('patches_report.txt', report, 'utf8');
console.log("Done");
