From 803413839d644cca0a14c2958c46d6ebe8f57e68 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Mon, 30 Oct 2023 17:05:56 -0300 Subject: upd8: step summary output style adjustments --- src/upd8.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/upd8.js b/src/upd8.js index 10fa43a..869d732 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -1199,15 +1199,28 @@ if (true || isMain(import.meta.url) || path.basename(process.argv[1]) === 'hsmus Object.values(stepStatusSummary) .map(({name}) => name.length)); - const anyStepsNotClean = + const stepsNotClean = Object.values(stepStatusSummary) - .some(({status}) => + .map(({status}) => status === STATUS_HAS_WARNINGS || status === STATUS_FATAL_ERROR || status === STATUS_STARTED_NOT_DONE); - for (const {name, status, annotation} of Object.values(stepStatusSummary)) { - let message = `${(name + ': ').padEnd(longestNameLength + 4, '.')} ${status}`; + const anyStepsNotClean = + stepsNotClean.includes(true); + + const stepDetails = Object.values(stepStatusSummary); + + for (let index = 0; index < stepDetails.length; index++) { + const {name, status, annotation} = stepDetails[index]; + + let message = + (stepsNotClean[index] + ? `!! ` + : ` - `); + + message += `${(name + ': ').padEnd(longestNameLength + 4, '.')} ${status}`; + if (annotation) { message += ` (${annotation})`; } @@ -1245,6 +1258,8 @@ if (true || isMain(import.meta.url) || path.basename(process.argv[1]) === 'hsmus } else { console.error(colors.bright(`Final output is true and all steps are clean.`)); } + } else if (result === false) { + console.error(colors.bright(`Final output is false.`)); } else { console.error(colors.bright(`Final output is not true (${result}).`)); } -- cgit 1.3.0-6-gf8a5