From f00e8c3a652fff47cf2b4adb41b2906271cc2994 Mon Sep 17 00:00:00 2001 From: Cory LaViska Date: Thu, 7 Dec 2023 16:30:37 -0500 Subject: [PATCH] prettier ci output --- scripts/build.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/scripts/build.js b/scripts/build.js index a53279f13..97d6a82b6 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -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`);