From 3ddcc59bc493e8da5eebd362c32273b2bdbb06f6 Mon Sep 17 00:00:00 2001 From: yasserare Date: Thu, 14 Dec 2023 15:20:57 +0100 Subject: [PATCH] feat: Adding to Webi package repository --- dist/webinstaller/README.md | 2 +- .../all-versions-manifest.json | 3 ++ .../make-webinstaller-manifest.js | 28 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 dist/webinstaller/all-versions-manifest/all-versions-manifest.json diff --git a/dist/webinstaller/README.md b/dist/webinstaller/README.md index 8bd8b82787..0081eb141c 100644 --- a/dist/webinstaller/README.md +++ b/dist/webinstaller/README.md @@ -2,7 +2,7 @@ This directory contains manifests for [webinstaller](https://webinstall.dev/), a developer tools installer. -The `make-webinstaller-manifest.js` script creates the output file with the appropriate release version number and its release date. +The `make-webinstaller-manifest.js` script creates the output file with the appropriate release version number and its release date, then add content of the output file into `all-versions-manifest/all-versions-manifest.json` which hosts all the data of every release. ## Manually building the manifest diff --git a/dist/webinstaller/all-versions-manifest/all-versions-manifest.json b/dist/webinstaller/all-versions-manifest/all-versions-manifest.json new file mode 100644 index 0000000000..a76f5259e4 --- /dev/null +++ b/dist/webinstaller/all-versions-manifest/all-versions-manifest.json @@ -0,0 +1,3 @@ +{ + "releases": [] +} diff --git a/dist/webinstaller/make-webinstaller-manifest.js b/dist/webinstaller/make-webinstaller-manifest.js index 7fd0ae18e9..a67da5382f 100644 --- a/dist/webinstaller/make-webinstaller-manifest.js +++ b/dist/webinstaller/make-webinstaller-manifest.js @@ -64,6 +64,34 @@ data = data.replace(/\${version}/g, releaseVersion); data = data.replace(/\${releaseDate}/g, releaseDate); fs.writeFileSync(outputFile, data, "utf8"); +//Global manifest +const versionSpecific = fs.readFileSync( + path.join(__dirname, "quick-lint-js.json"), + "utf8" +); + +const allVersions = fs.readFileSync( + path.join(__dirname, "all-versions-manifest/all-versions-manifest.json"), + "utf8" +); + +const versionSpecificData = JSON.parse(versionSpecific); +const allVersionsData = JSON.parse(allVersions); + +const concatenatedArray = allVersionsData.releases.concat( + versionSpecificData.releases +); + +allVersionsData.releases = concatenatedArray; + +const updatedAllVersionsContent = JSON.stringify(allVersionsData, null, 2); + +fs.writeFileSync( + "all-versions-manifest/all-versions-manifest.json", + updatedAllVersionsContent, + "utf8" +); + // quick-lint-js finds bugs in JavaScript programs. // Copyright (C) 2020 Matthew "strager" Glazar //