prettier ci output

This commit is contained in:
Cory LaViska
2023-12-07 16:30:37 -05:00
parent a4f8bf94ee
commit f00e8c3a65

View File

@@ -158,19 +158,22 @@ function exit() {
// Helper function to cleanly log tasks
//
async function nextTask(label, action) {
function clearLine() {
if (process.stdout.isTTY) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
} else {
process.stdout.write('\n');
}
}
try {
process.stdout.write(`${chalk.yellow('•')} ${label}`);
await action();
if (process.stdout.isTTY) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
}
clearLine();
process.stdout.write(`${chalk.green('✔')} ${label}\n`);
} catch (err) {
if (process.stdout.isTTY) {
process.stdout.clearLine();
process.stdout.cursorTo(0);
}
clearLine();
process.stdout.write(`${chalk.red('✘')} ${label}\n\n`);
if (err.stdout) process.stdout.write(`${chalk.red(err.stdout)}\n`);
if (err.stderr) process.stdout.write(`${chalk.red(err.stderr)}\n`);