From e79bde9baead5d38d07cae8c09f89781f31fc7ed Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Fri, 5 Mar 2021 22:00:09 -0400 Subject: --skip-thumbs option and extra CLI info --- upd8.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/upd8.js b/upd8.js index 9dd2e2c..7d191e0 100755 --- a/upd8.js +++ b/upd8.js @@ -5164,6 +5164,13 @@ async function main() { type: 'value' }, + // Thum8nail gener8tion is *usually* something you want, 8ut it can 8e + // kinda a pain to run every time, since it does necessit8te reading + // every media file at run time. Pass this to skip it. + 'skip-thumbs': { + type: 'flag' + }, + 'queue-size': { type: 'value', validate(size) { @@ -5198,11 +5205,17 @@ async function main() { } } - logInfo`Begin thumbnail generation... -----+`; - const result = await genThumbs(mediaPath, {queueSize, quiet: true}); - logInfo`Done thumbnail generation! --------+`; - if (!result) { - return; + const skipThumbs = miscOptions['skip-thumbs'] ?? false; + + if (skipThumbs) { + logInfo`Skipping thumbnail generation.`; + } else { + logInfo`Begin thumbnail generation... -----+`; + const result = await genThumbs(mediaPath, {queueSize, quiet: true}); + logInfo`Done thumbnail generation! --------+`; + if (!result) { + return; + } } const defaultStrings = await processLanguageFile(path.join(__dirname, DEFAULT_STRINGS_FILE)); @@ -5234,6 +5247,8 @@ async function main() { languages[defaultStrings.code] = defaultStrings; } + logInfo`Loaded language strings: ${Object.keys(languages).join(', ')}`; + wikiInfo = await processWikiInfoFile(path.join(dataPath, WIKI_INFO_FILE)); if (wikiInfo.error) { console.log(`\x1b[31;1m${wikiInfo.error}\x1b[0m`); @@ -5703,6 +5718,8 @@ async function main() { const buildAll = !Object.keys(buildFlags).length || buildFlags.all; + logInfo`Building site pages: ${buildAll ? 'all' : Object.keys(buildFlags).join(', ')}`; + await writeSymlinks(); await writeSharedFilesAndPages({strings: defaultStrings}); -- cgit 1.3.0-6-gf8a5