« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/upd8.js
diff options
context:
space:
mode:
Diffstat (limited to 'upd8.js')
-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});