diff options
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-x | src/upd8.js | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/upd8.js b/src/upd8.js index 24fba6ba..836ff6b2 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -42,8 +42,11 @@ import wrap from 'word-wrap'; // order. This obviously needs fixing up. /* precede #find */ -import {filterReferenceErrors, reportDuplicateDirectories} - from '#data-checks'; +import { + filterReferenceErrors, + reportDuplicateDirectories, + reportContentTextErrors, +} from '#data-checks'; import {bindFind, getAllFindSpecs} from '#find'; @@ -138,11 +141,14 @@ async function main() { {...defaultStepStatus, name: `precache common data`}, reportDuplicateDirectories: - {...defaultStepStatus, name: `filter duplicate directories`}, + {...defaultStepStatus, name: `report duplicate directories`}, filterReferenceErrors: {...defaultStepStatus, name: `filter reference errors`}, + reportContentTextErrors: + {...defaultStepStatus, name: `report content text errors`}, + sortWikiDataArrays: {...defaultStepStatus, name: `sort wiki data arrays`}, @@ -1184,6 +1190,35 @@ async function main() { } } + if (stepStatusSummary.reportContentTextErrors.status === STATUS_NOT_STARTED) { + Object.assign(stepStatusSummary.reportContentTextErrors, { + status: STATUS_STARTED_NOT_DONE, + timeStart: Date.now(), + }); + + try { + reportContentTextErrors(wikiData, {bindFind}); + logInfo`All content text validated without any errors - nice!`; + + Object.assign(stepStatusSummary.reportContentTextErrors, { + status: STATUS_DONE_CLEAN, + timeEnd: Date.now(), + }); + } catch (error) { + niceShowAggregate(error); + + logWarn`The above errors were detected while processing content text in data files.`; + logWarn`The wiki will still build, but placeholders will be displayed in these spots.`; + logWarn`Resolve the errors for more complete output.`; + + Object.assign(stepStatusSummary.reportContentTextErrors, { + status: STATUS_HAS_WARNINGS, + annotation: `view log for details`, + timeEnd: Date.now(), + }); + } + } + // Sort data arrays so that they're all in order! This may use properties // which are only available after the initial linking. |