diff options
author | (quasar) nebula <qznebula@protonmail.com> | 2024-03-26 15:20:48 -0300 |
---|---|---|
committer | (quasar) nebula <qznebula@protonmail.com> | 2024-05-31 12:11:44 -0300 |
commit | fa969b9dd99d18a3c5f77300a79a9c923ce280ce (patch) | |
tree | 52dcd1cc1e870c627975d7bff09542a7ecb3bacf /src/upd8.js | |
parent | d1b7f655df1918f04e013acbb4ec0eb36122c40b (diff) |
search, upd8: write index into wikiCachePath
Diffstat (limited to 'src/upd8.js')
-rwxr-xr-x | src/upd8.js | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/upd8.js b/src/upd8.js index 17fd7d7c..473a9514 100755 --- a/src/upd8.js +++ b/src/upd8.js @@ -769,14 +769,23 @@ async function main() { buildConfig: 'webRoutes', }); - fallbackStep('buildSearchIndex', { - default: 'perform', - buildConfig: 'search', - cli: { - flag: 'skip-search', - negate: true, - }, - }); + if (wikiCachePath) { + fallbackStep('buildSearchIndex', { + default: 'perform', + buildConfig: 'search', + cli: { + flag: 'skip-search', + negate: true, + }, + }); + } else { + logInfo`No wiki cache provided, so not writing search index.`; + + Object.assign(stepStatusSummary.buildSearchIndex, { + status: STATUS_NOT_APPLICABLE, + annotation: `no wiki cache to write into`, + }); + } fallbackStep('verifyImagePaths', { default: 'perform', @@ -1480,10 +1489,10 @@ async function main() { timeStart: Date.now(), }); - const searchIndexPath = path.join(mediaPath, "search_index.json"); - logInfo`Search index: ${searchIndexPath}`; - - await writeSearchIndex(searchIndexPath, wikiData); + await writeSearchIndex({ + wikiCachePath, + wikiData, + }); Object.assign(stepStatusSummary.buildSearchIndex, { status: STATUS_DONE_CLEAN, |