diff --git a/make-pluginmasterjson.js b/make-pluginmasterjson.js index 183a49e..aa11f16 100644 --- a/make-pluginmasterjson.js +++ b/make-pluginmasterjson.js @@ -1,5 +1,5 @@ -const fs = require('fs'); -var execSync = require('child_process').execSync; +const fs = require("fs"); +var execSync = require("child_process").execSync; const API_LEVEL = 6; /* @@ -36,37 +36,35 @@ const API_LEVEL = 6; */ +fs.readdir("./plugins", (err, files) => { + const categoryFallbacks = JSON.parse(fs.readFileSync("./categoryfallbacks.json").toString()); -fs.readdir('./plugins', (err, files) => { - const categoryFallbacks = JSON.parse(fs.readFileSync('./categoryfallbacks.json').toString()); + let masterJson = []; + for (let d of files) { + console.log(d); + const pluginJsonPath = `plugins/${d}/${d}.json`; - let masterJson = []; - for (let d of files) { - console.log(d); - const pluginJsonPath = `plugins/${d}/${d}.json`; + const pluginJson = JSON.parse(fs.readFileSync(pluginJsonPath).toString()); - const pluginJson = JSON.parse(fs.readFileSync(pluginJsonPath).toString()); + console.log(pluginJson); - console.log(pluginJson); + const updatedDate = execSync(`git log -1 --pretty="format:%ct" plugins/${pluginJson.InternalName}/latest.zip`).toString(); + const masterJsonInsert = { + ...pluginJson, + LastUpdate: updatedDate, + IsHide: "False", + DownloadCount: 69420, + IsTestingExclusive: "False", + CategoryTags: pluginJson.CategoryTags ?? categoryFallbacks[pluginJson.InternalName], + DownloadLinkInstall: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip`, + DownloadLinkTesting: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip`, + DownloadLinkUpdate: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip`, + }; - const updatedDate = execSync(`git log -1 --pretty="format:%ct" plugins/${pluginJson.InternalName}/latest.zip`).toString(); + masterJson.push(masterJsonInsert); + console.log(masterJsonInsert); + } - const masterJsonInsert = { - ...pluginJson, - LastUpdate: updatedDate, - IsHide: "False", - DownloadCount: 0, - IsTestingExclusive: "False", - CategoryTags: pluginJson.CategoryTags ?? categoryFallbacks[pluginJson.InternalName], - DownloadLinkInstall: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip`, - DownloadLinkTesting: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip`, - DownloadLinkUpdate: `https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/${pluginJson.InternalName}/latest.zip` - } - - masterJson.push(masterJsonInsert); - console.log(masterJsonInsert); - } - - fs.writeFileSync('./pluginmaster.json', JSON.stringify(masterJson, null, 2)); -}) \ No newline at end of file + fs.writeFileSync("./pluginmaster.json", JSON.stringify(masterJson, null, 2)); +}); diff --git a/pluginmaster.json b/pluginmaster.json index 7c23281..0c9047a 100644 --- a/pluginmaster.json +++ b/pluginmaster.json @@ -16,7 +16,7 @@ "Changelog": "0.0.0.1\nInitial release for testing", "LastUpdate": "1666725609", "IsHide": "False", - "DownloadCount": 0, + "DownloadCount": 69420, "IsTestingExclusive": "False", "DownloadLinkInstall": "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/AntiDickheadChatmodule/latest.zip", "DownloadLinkTesting": "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/AntiDickheadChatmodule/latest.zip", @@ -40,7 +40,7 @@ "Changelog": "0.0.0.21\nSeason 2 game tracking fixed\n\n0.0.0.20\nFixed class selection, season 3\n\n0.0.0.19\nMissing json config\n\n0.0.0.18\nBugfixes left over\n0.0.0.17\nAPI 7, season 2\n\n0.0.0.16\nDefaulted to season 2 from all\n0.0.0.15\nAdded seasons support\n0.0.0.14\nRandom errors fix\n\n0.0.0.13\nToobig....\n\n0.0.0.12\nHelp-text replaced with a proper one lol\n\n0.0.0.11\nBETTER COLOURS\n\n0.0.0.10\nCOLOURS\n\n0.0.0.9\nCrash fixes\n\n0.0.0.7\nBugfixes\n\n0.0.0.6\nTotal wins tracked across all classes\n\n0.0.0.5\nNamechange", "LastUpdate": "1664642108", "IsHide": "False", - "DownloadCount": 0, + "DownloadCount": 69420, "IsTestingExclusive": "False", "DownloadLinkInstall": "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/CrystallineConflictWinsTracker/latest.zip", "DownloadLinkTesting": "https://raw.githubusercontent.com/aRkker/DalamudPlugins/master/plugins/CrystallineConflictWinsTracker/latest.zip", @@ -66,7 +66,7 @@ "Changelog": "1.0.0.4\n API 71.0.0.3\n Testing changelog :)", "LastUpdate": "1661419042", "IsHide": "False", - "DownloadCount": 0, + "DownloadCount": 69420, "IsTestingExclusive": "False", "CategoryTags": [ "utility",