Small tweaks

This commit is contained in:
pietervdvn 2021-04-10 16:06:01 +02:00
parent 081a281c04
commit cd6f511bda
5 changed files with 17 additions and 12 deletions

View file

@ -24,10 +24,10 @@ jobs:
- name: create stub themes - name: create stub themes
run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json" run: "echo '{\"layers\": [], \"themes\": []}' > ./assets/generated/known_layers_and_themes.json"
- name: Compile license info; creates missing_licenses.txt if any missing
- name: Compile license info
run: npm run validate:licenses run: npm run validate:licenses
- name: Compile and validate themes and layers - name: Compile and validate themes and layers; creates layer_report.txt if any errors are found
run: npm run validate:layeroverview run: npm run validate:layeroverview

View file

@ -26,7 +26,7 @@ jobs:
- name: Compile license info - name: Compile license info
run: npm run validate:licenses run: npm run generate:licenses
- name: Compile and validate themes and layers - name: Compile themes and layers
run: npm run validate:layeroverview run: npm run generate:layeroverview

View file

@ -15,8 +15,8 @@
"generate:translations": "ts-node scripts/generateTranslations.ts", "generate:translations": "ts-node scripts/generateTranslations.ts",
"generate:layouts": "ts-node scripts/generateLayouts.ts", "generate:layouts": "ts-node scripts/generateLayouts.ts",
"generate:docs": "ts-node scripts/generateDocs.ts", "generate:docs": "ts-node scripts/generateDocs.ts",
"generate:layeroverview": "ts-node scripts/generateLayerOverview.ts --no-fail", "generate:layeroverview": "ts-node scripts/generateLayerOverview.ts",
"generate:licenses": "ts-node scripts/generateLicenseInfo.ts --no-fail", "generate:licenses": "ts-node scripts/generateLicenseInfo.ts",
"validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report", "validate:layeroverview": "ts-node scripts/generateLayerOverview.ts --report",
"validate:licenses": "ts-node scripts/generateLicenseInfo.ts --report", "validate:licenses": "ts-node scripts/generateLicenseInfo.ts --report",
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",

View file

@ -98,7 +98,7 @@ for (const themeFile of themeFiles) {
} }
} else { } else {
// layer.builtin contains layer overrides - we can skip those // layer.builtin contains layer overrides - we can skip those
layerErrorCount .push(validateLayer(layer, themeFile.id)) layerErrorCount .push(...validateLayer(layer, themeFile.id))
} }
} }
} }
@ -116,6 +116,9 @@ for (const themeFile of themeFiles) {
themeErrorCount.push("Could not parse theme "+ themeFile["id"]+ "due to", e) themeErrorCount.push("Could not parse theme "+ themeFile["id"]+ "due to", e)
} }
} }
console.log("LE", layerErrorCount)
if (layerErrorCount.length + themeErrorCount.length == 0) { if (layerErrorCount.length + themeErrorCount.length == 0) {
console.log("All good!") console.log("All good!")
} else { } else {
@ -125,7 +128,7 @@ if (layerErrorCount.length + themeErrorCount.length == 0) {
if(process.argv.indexOf("--no-fail") >= 0) { if(process.argv.indexOf("--no-fail") >= 0) {
console.log(msg) console.log(msg)
}else if(process.argv.indexOf("--report") >= 0){ }else if(process.argv.indexOf("--report") >= 0){
writeFileSync("layer-report.txt", errors) writeFileSync("layer_report.txt", errors)
}else{ }else{
throw msg; throw msg;

View file

@ -202,6 +202,8 @@ if(missingLicenses.length > 0){
const msg = `There are ${missingLicenses.length} licenses missing.` const msg = `There are ${missingLicenses.length} licenses missing.`
if(process.argv.indexOf("--no-fail") >= 0){ if(process.argv.indexOf("--no-fail") >= 0){
console.log(msg) console.log(msg)
}else if(process.argv.indexOf("--report") >= 0){
writeFileSync("missing_licenses.txt", missingLicenses.join("\n"))
} else{ } else{
throw msg throw msg