« get me outta code hell

--skip-thumbs option and extra CLI info - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-03-05 22:00:09 -0400
committer(quasar) nebula <towerofnix@gmail.com>2021-03-05 22:00:09 -0400
commite79bde9baead5d38d07cae8c09f89781f31fc7ed (patch)
tree834ddc58d8e29d3a898747ada11d68e6ef906342
parent1a23b80b3d22911a5b4c24afcdac50fb3618d8ca (diff)
--skip-thumbs option and extra CLI info
-rwxr-xr-xupd8.js27
1 files changed, 22 insertions, 5 deletions
diff --git a/upd8.js b/upd8.js
index 9dd2e2c5..7d191e0d 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});