/** * Print a standardized final SUCCESS/FAILED banner and exit. * Always the last stdout before process exit in deploy scripts. */ const WIDTH = 72; function printCliResult({ script, ok, summary, details = [] }) { const label = ok ? 'SUCCESS' : 'FAILED'; const banner = `===== ${label}: ${script} =====`; const pad = Math.max(0, WIDTH - banner.length); const line = banner + '='.repeat(pad); console.log(''); console.log(line); if (summary) console.log(summary); for (const detail of details) { if (detail) console.log(detail); } console.log('='.repeat(WIDTH)); process.exit(ok ? 0 : 1); } module.exports = { printCliResult };