Updates to files and upgrade advice

This commit is contained in:
Chris Hunt
2024-08-13 17:37:46 +01:00
parent 225926bdc1
commit 39bac68494
7 changed files with 73 additions and 11 deletions

View File

@@ -41,7 +41,7 @@ glob("**/workspace.json", async function (err, files) {
let parsed = JSON.parse(filedata);
parsed.sha = hash.hash;
console.log(parsed.name + ' added')
console.log(parsed.friendly_name + ' added')
parsed.compatibility.forEach((element, index) => {
if ('available_tags' in element) {
element.available_tags.forEach((el) => {

View File

@@ -0,0 +1,41 @@
const fs = require("fs");
const glob = require("glob");
glob("../workspaces/**/workspace.json", async function (err, files) {
if (err) {
console.log(
"cannot read the folder, something goes wrong with glob",
err
);
}
for (const file of files) {
let filedata = fs.readFileSync(file);
let parsed = JSON.parse(filedata);
delete parsed.compatibility
parsed.compatibility = []
let details = {
version: '1.16.x',
image: parsed.name.split(':')[0] + ':1.16.0-rolling-daily',
uncompressed_size_mb: 0,
available_tags: [
'develop',
'1.16.0',
'1.16.0-rolling-weekly',
'1.16.0-rolling-daily'
]
}
parsed.compatibility.push(details)
delete parsed.uncompressed_size_mb
delete parsed.name
fs.writeFileSync(file, JSON.stringify(parsed, null, 2));
}
});