Updates to files and upgrade advice
This commit is contained in:
@@ -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) => {
|
||||
|
41
processing/update_1_0_to_1_1.js
Normal file
41
processing/update_1_0_to_1_1.js
Normal 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));
|
||||
}
|
||||
|
||||
|
||||
});
|
Reference in New Issue
Block a user