« get me outta code hell

don't hard-code page build flags in upd8.js - 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-06-03 11:45:48 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-06-03 11:45:48 -0300
commit9f81855af35aaf1dc5ef3773e263b7a505c85396 (patch)
tree4c56f4631760bc715e99301df9604ff6d3f1824a
parent73e2f31b6d8eccb938b65a7337ed856d882d822a (diff)
don't hard-code page build flags in upd8.js
At the moment, they're hard-coded in page/index.js, which isn't exactly
a *lot* 8etter....? 8ut this gets rid of a duplic8te place, at least!
-rwxr-xr-xsrc/upd8.js34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/upd8.js b/src/upd8.js
index a2262d6a..e6a880dc 100755
--- a/src/upd8.js
+++ b/src/upd8.js
@@ -5358,6 +5358,8 @@ async function main() {
     // disa8les the queue feature altogether.
     queueSize = +(miscOptions['queue-size'] ?? 0);
 
+    const buildDictionary = pageSpecs;
+
     // NOT for ena8ling or disa8ling specific features of the site!
     // This is only in charge of what general groups of files to 8uild.
     // They're here to make development quicker when you're only working
@@ -5366,17 +5368,9 @@ async function main() {
     const writeFlags = await parseOptions(process.argv.slice(2), {
         all: {type: 'flag'}, // Defaults to true if none 8elow specified.
 
-        album: {type: 'flag'},
-        artist: {type: 'flag'},
-        commentary: {type: 'flag'},
-        flash: {type: 'flag'},
-        group: {type: 'flag'},
-        list: {type: 'flag'},
-        misc: {type: 'flag'},
-        news: {type: 'flag'},
-        static: {type: 'flag'},
-        tag: {type: 'flag'},
-        track: {type: 'flag'},
+        // Kinda a hack t8h!
+        ...Object.fromEntries(Object.keys(buildDictionary)
+            .map(key => [key, {type: 'flag'}])),
 
         [parseOptions.handleUnknown]: () => {}
     });
@@ -5388,24 +5382,6 @@ async function main() {
     await writeSymlinks();
     await writeSharedFilesAndPages({strings: defaultStrings, wikiData});
 
-    /*
-    const buildDictionary = {
-        misc: writeMiscellaneousPages,
-        news: writeNewsPages,
-        list: writeListingPages,
-        tag: writeTagPages,
-        commentary: writeCommentaryPages,
-        static: writeStaticPages,
-        group: writeGroupPages,
-        album: writeAlbumPages,
-        track: writeTrackPages,
-        artist: writeArtistPages,
-        flash: writeFlashPages
-    };
-    */
-
-    const buildDictionary = pageSpecs;
-
     const buildSteps = (writeAll
         ? Object.entries(buildDictionary)
         : (Object.entries(buildDictionary)