Files
Art-gallery/scripts/lib/cli-result.js
Danila KhodjaefandCursor 21e3e41e48 Add one-command dev-to-prod release with clear SUCCESS/FAILED banners.
Introduce devtoprod:release orchestrator, config file, CLI result footers on deploy scripts, auto-thumb regeneration on curator fixes, and updated deploy documentation.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 14:54:56 +03:00

25 lines
661 B
JavaScript

/**
* 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 };