Add check for unlinked READMEs

master
Gordon Williams 2023-03-09 09:54:26 +00:00
parent 735ab75b39
commit 94be5d4627
6 changed files with 14 additions and 2 deletions

View File

@ -6,6 +6,7 @@
"icon": "app.png", "icon": "app.png",
"tags": "back,gesture,swipe", "tags": "back,gesture,swipe",
"supports" : ["BANGLEJS2"], "supports" : ["BANGLEJS2"],
"readme":"README.md",
"type": "bootloader", "type": "bootloader",
"storage": [ "storage": [
{"name":"backswipe.boot.js","url":"boot.js"}, {"name":"backswipe.boot.js","url":"boot.js"},

View File

@ -7,6 +7,7 @@
"icon": "icon.png", "icon": "icon.png",
"tags": "health,tool,sensors,bluetooth", "tags": "health,tool,sensors,bluetooth",
"supports": ["BANGLEJS2"], "supports": ["BANGLEJS2"],
"readme":"README.md",
"storage": [ "storage": [
{"name":"btadv.app.js","url":"app.js"}, {"name":"btadv.app.js","url":"app.js"},
{"name":"btadv.img","url":"icon.js","evaluate":true} {"name":"btadv.img","url":"icon.js","evaluate":true}

View File

@ -7,6 +7,7 @@
"type": "clkinfo", "type": "clkinfo",
"tags": "clkinfo,timer", "tags": "clkinfo,timer",
"supports" : ["BANGLEJS2"], "supports" : ["BANGLEJS2"],
"readme":"README.md",
"allow_emulator": true, "allow_emulator": true,
"storage": [ "storage": [
{"name":"stopw.clkinfo.js","url":"clkinfo.js"} {"name":"stopw.clkinfo.js","url":"clkinfo.js"}

View File

@ -7,6 +7,7 @@
"icon": "app.png", "icon": "app.png",
"tags": "tool,torch", "tags": "tool,torch",
"supports": ["BANGLEJS","BANGLEJS2"], "supports": ["BANGLEJS","BANGLEJS2"],
"readme":"README.md",
"storage": [ "storage": [
{"name":"torch.app.js","url":"app.js"}, {"name":"torch.app.js","url":"app.js"},
{"name":"torch.wid.js","url":"widget.js","supports": ["BANGLEJS"]}, {"name":"torch.wid.js","url":"widget.js","supports": ["BANGLEJS"]},

View File

@ -6,7 +6,8 @@
"type": "widget", "type": "widget",
"description": "A simple widget that shows a yellow lightning icon to indicate whenever the watch is charging. This way one can see the charging status at a glance, no matter which battery widget is being used.", "description": "A simple widget that shows a yellow lightning icon to indicate whenever the watch is charging. This way one can see the charging status at a glance, no matter which battery widget is being used.",
"tags": "widget", "tags": "widget",
"supports": ["BANGLEJS","BANGLEJS2"], "supports": ["BANGLEJS","BANGLEJS2"],
"readme":"README.md",
"storage": [ "storage": [
{"name":"widChargingStatus.wid.js","url":"widget.js"} {"name":"widChargingStatus.wid.js","url":"widget.js"}
] ]

View File

@ -162,7 +162,14 @@ apps.forEach((app,appIdx) => {
ERROR(`App ${app.id} screenshot file ${screenshot.url} not found`, {file:metadataFile}); ERROR(`App ${app.id} screenshot file ${screenshot.url} not found`, {file:metadataFile});
}); });
} }
if (app.readme && !fs.existsSync(appDir+app.readme)) ERROR(`App ${app.id} README file doesn't exist`, {file:metadataFile}); if (app.readme) {
if (!fs.existsSync(appDir+app.readme))
ERROR(`App ${app.id} README file doesn't exist`, {file:metadataFile});
} else {
let readme = fs.readdirSync(appDir).find(f => f.toLowerCase().includes("readme"));
if (readme)
ERROR(`App ${app.id} has a README in the directory (${readme}) but it's not linked`, {file:metadataFile});
}
if (app.custom && !fs.existsSync(appDir+app.custom)) ERROR(`App ${app.id} custom HTML doesn't exist`, {file:metadataFile}); if (app.custom && !fs.existsSync(appDir+app.custom)) ERROR(`App ${app.id} custom HTML doesn't exist`, {file:metadataFile});
if (app.customConnect && !app.custom) ERROR(`App ${app.id} has customConnect but no customn HTML`, {file:metadataFile}); if (app.customConnect && !app.custom) ERROR(`App ${app.id} has customConnect but no customn HTML`, {file:metadataFile});
if (app.interface && !fs.existsSync(appDir+app.interface)) ERROR(`App ${app.id} interface HTML doesn't exist`, {file:metadataFile}); if (app.interface && !fs.existsSync(appDir+app.interface)) ERROR(`App ${app.id} interface HTML doesn't exist`, {file:metadataFile});