« get me outta code hell

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