Small tweaks to the deploy scripts

This commit is contained in:
Pieter Vander Vennet 2021-04-10 15:01:28 +02:00
parent 4e1fc46ff2
commit a8aaf4b219
10 changed files with 65 additions and 19 deletions

View file

@ -9,6 +9,10 @@ function genImages() {
const allNames: string[] = [];
for (const path of dir) {
if(path.endsWith("license_info.json")){
continue;
}
if (!path.endsWith(".svg")) {
throw "Non-svg file detected in the svg files: " + path;
}

View file

@ -117,5 +117,9 @@ if (layerErrorCount + themeErrorCount == 0) {
console.log("All good!")
} else {
const msg = (`Found ${layerErrorCount} errors in the layers; ${themeErrorCount} errors in the themes`)
throw msg;
if(process.argv.indexOf("--no-fail") >= 0){
console.log(msg)
}else{
throw msg;
}
}

View file

@ -3,13 +3,13 @@ import {Utils} from "../Utils";
Utils.runningFromConsole = true;
import LayoutConfig from "../Customizations/JSON/LayoutConfig";
import {AllKnownLayouts} from "../Customizations/AllKnownLayouts";
import {existsSync, mkdirSync, readFileSync, writeFile, writeFileSync} from "fs";
import Locale from "../UI/i18n/Locale";
import Translations from "../UI/i18n/Translations";
import {Translation} from "../UI/i18n/Translation";
import Constants from "../Models/Constants";
import * as all_known_layouts from "../assets/generated/known_layers_and_themes.json"
import {LayoutConfigJson} from "../Customizations/JSON/LayoutConfigJson";
const sharp = require('sharp');
@ -234,9 +234,12 @@ if (!existsSync(generatedDir)) {
}
const blacklist = ["", "test", ".", "..", "manifest", "index", "land", "preferences", "account", "openstreetmap", "custom"]
const all = AllKnownLayouts.allKnownLayouts;
const all : LayoutConfigJson[] = all_known_layouts.themes;
for (const layoutName in all) {
for (const i in all) {
const layoutConfigJson : LayoutConfigJson = all[i]
const layout = new LayoutConfig(layoutConfigJson, true, "generating layouts")
const layoutName = layout.id
if (blacklist.indexOf(layoutName.toLowerCase()) >= 0) {
console.log(`Skipping a layout with name${layoutName}, it is on the blacklist`);
continue;
@ -246,7 +249,6 @@ for (const layoutName in all) {
console.log("Could not write manifest for ", layoutName, " because ", err)
}
};
const layout = all[layoutName];
validate(layout)
createManifest(layout, "").then(manifObj => {
const manif = JSON.stringify(manifObj, undefined, 2);

View file

@ -182,16 +182,19 @@ writeFileSync("./assets/generated/license_info.json", JSON.stringify(licenseInfo
const artwork = contents.filter(pth => pth.match(/(.svg|.png|.jpg)$/i) != null)
const missingLicenses = missingLicenseInfos(licenseInfos, artwork)
cleanLicenseInfo(licensePaths, licenseInfos)
if(missingLicenses.length > 0){
const msg = `There are ${missingLicenses.length} licenses missing.`
/*
console.log(msg)
/*/
throw msg
//*/
if(process.argv.indexOf("--no-fail") >= 0){
console.log(msg)
}else{
throw msg
}
}
// queryMissingLicenses(missingLicenses)
if(process.argv.indexOf("--prompt") >= 0) {
queryMissingLicenses(missingLicenses)
}
cleanLicenseInfo(licensePaths, licenseInfos)