diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2023-10-30 17:05:56 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2023-10-30 17:05:56 -0300 |
commit | 803413839d644cca0a14c2958c46d6ebe8f57e68 (patch) | |
tree | 4be57c8de0c5c2ee0a5a082b534fbb5568c16c76 | |
parent | 5f8b0426c27b4aafa2325ace72117d5259ad743e (diff) |
upd8: step summary output style adjustments
-rwxr-xr-x | src/upd8.js | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/upd8.js b/src/upd8.js index 10fa43ae..869d7324 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}).`)); } |