| 
									
										
										
										
											2021-09-09 00:05:51 +02:00
										 |  |  | import {existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync} from "fs"; | 
					
						
							| 
									
										
										
										
											2021-04-09 02:57:06 +02:00
										 |  |  | import SmallLicense from "../Models/smallLicense"; | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  | import ScriptUtils from "./ScriptUtils"; | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-09 22:37:21 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | function validateLicenseInfo(l : SmallLicense){ | 
					
						
							|  |  |  |    l.sources.map(s => new URL(s)) | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * Sweeps the entire 'assets/' (except assets/generated) directory for image files and any 'license_info.json'-file. | 
					
						
							|  |  |  |  * Checks that the license info is included for each of them and generates a compiles license_info.json for those | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function generateLicenseInfos(paths: string[]): SmallLicense[] { | 
					
						
							|  |  |  |     const licenses = [] | 
					
						
							|  |  |  |     for (const path of paths) { | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |         try { | 
					
						
							|  |  |  |             const parsed = JSON.parse(readFileSync(path, "UTF-8")) | 
					
						
							|  |  |  |             if (Array.isArray(parsed)) { | 
					
						
							|  |  |  |                 const l: SmallLicense[] = parsed | 
					
						
							|  |  |  |                 for (const smallLicens of l) { | 
					
						
							|  |  |  |                     smallLicens.path = path.substring(0, path.length - "license_info.json".length) + smallLicens.path | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 licenses.push(...l) | 
					
						
							|  |  |  |             } else { | 
					
						
							|  |  |  |                 const smallLicens: SmallLicense = parsed; | 
					
						
							|  |  |  |                 smallLicens.path = path.substring(0, 1 + path.lastIndexOf("/")) + smallLicens.path | 
					
						
							|  |  |  |                 licenses.push(smallLicens) | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |             } | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |         } catch (e) { | 
					
						
							|  |  |  |             console.error("Error: ", e, "while handling", path) | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return licenses | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function missingLicenseInfos(licenseInfos: SmallLicense[], allIcons: string[]) { | 
					
						
							|  |  |  |     const missing = [] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const knownPaths = new Set<string>() | 
					
						
							|  |  |  |     for (const licenseInfo of licenseInfos) { | 
					
						
							|  |  |  |         knownPaths.add(licenseInfo.path) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for (const iconPath of allIcons) { | 
					
						
							|  |  |  |         if (iconPath.indexOf("license_info.json") >= 0) { | 
					
						
							|  |  |  |             continue; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         if (knownPaths.has(iconPath)) { | 
					
						
							|  |  |  |             continue; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         missing.push(iconPath) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     return missing; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const prompt = require('prompt-sync')(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  | const knownLicenses = new Map<string, SmallLicense>() | 
					
						
							|  |  |  | knownLicenses.set("me", { | 
					
						
							|  |  |  |     authors: ["Pieter Vander Vennet"], | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     path: undefined, | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  |     license: "CC0", | 
					
						
							|  |  |  |     sources: [] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-17 16:13:35 +02:00
										 |  |  | knownLicenses.set("streetcomplete", { | 
					
						
							|  |  |  |     authors: ["Tobias Zwick (westnordost)"], | 
					
						
							|  |  |  |     path: undefined, | 
					
						
							|  |  |  |     license: "CC0", | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  |     sources: ["https://github.com/streetcomplete/StreetComplete/tree/master/res/graphics", "https://f-droid.org/packages/de.westnordost.streetcomplete/"] | 
					
						
							| 
									
										
										
										
											2021-09-17 16:13:35 +02:00
										 |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  | knownLicenses.set("t", { | 
					
						
							|  |  |  |     authors: [], | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     path: undefined, | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  |     license: "CC0; trivial", | 
					
						
							|  |  |  |     sources: [] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | knownLicenses.set("na", { | 
					
						
							|  |  |  |     authors: [], | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     path: undefined, | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  |     license: "CC0", | 
					
						
							|  |  |  |     sources: [] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-04 00:45:22 +01:00
										 |  |  | knownLicenses.set("tv", { | 
					
						
							|  |  |  |     authors: ["Toerisme Vlaanderen"], | 
					
						
							|  |  |  |     path: undefined, | 
					
						
							|  |  |  |     license: "CC0", | 
					
						
							|  |  |  |     sources: ["https://toerismevlaanderen.be/pinjepunt","https://mapcomplete.osm.be/toerisme_vlaanderenn"] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-06 04:06:02 +01:00
										 |  |  | knownLicenses.set("tvf", { | 
					
						
							|  |  |  |     authors: ["Jo De Baerdemaeker "], | 
					
						
							|  |  |  |     path: undefined, | 
					
						
							|  |  |  |     license: "All rights reserved", | 
					
						
							|  |  |  |     sources: ["https://www.studiotype.be/fonts/flandersart"] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-04 00:45:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-01-25 21:55:51 +01:00
										 |  |  | knownLicenses.set("twemoji", { | 
					
						
							|  |  |  |     authors: ["Twemoji"], | 
					
						
							|  |  |  |     path: undefined, | 
					
						
							|  |  |  |     license: "CC-BY 4.0", | 
					
						
							|  |  |  |     sources: ["https://github.com/twitter/twemoji"] | 
					
						
							|  |  |  | }) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | function promptLicenseFor(path): SmallLicense { | 
					
						
							| 
									
										
										
										
											2021-04-09 00:19:32 +02:00
										 |  |  |     console.log("License abbreviations:") | 
					
						
							|  |  |  |     knownLicenses.forEach((value, key) => { | 
					
						
							|  |  |  |         console.log(key, " => ", value) | 
					
						
							|  |  |  |     }) | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  |     const author = prompt("What is the author for artwork " + path + "? (or: [Q]uit, [S]kip)  > ") | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |     path = path.substring(path.lastIndexOf("/") + 1) | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     if (knownLicenses.has(author)) { | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  |         const license = knownLicenses.get(author); | 
					
						
							|  |  |  |         license.path = path; | 
					
						
							|  |  |  |         return license; | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-07 21:58:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     if (author == "s") { | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |         return null; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if (author == "Q" || author == "q" || author == "") { | 
					
						
							|  |  |  |         throw "Quitting now!" | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-09 00:19:32 +02:00
										 |  |  |     let authors = author.split(";") | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     if (author.toLowerCase() == "none") { | 
					
						
							| 
									
										
										
										
											2021-04-09 00:19:32 +02:00
										 |  |  |         authors = [] | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |     return { | 
					
						
							|  |  |  |         authors: author.split(";"), | 
					
						
							|  |  |  |         path: path, | 
					
						
							|  |  |  |         license: prompt("What is the license for artwork " + path + "?  > "), | 
					
						
							|  |  |  |         sources: prompt("Where was this artwork found?  > ").split(";") | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | function createLicenseInfoFor(path): void { | 
					
						
							|  |  |  |     const li = promptLicenseFor(path); | 
					
						
							| 
									
										
										
										
											2021-04-10 03:18:32 +02:00
										 |  |  |     if (li == null) { | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  |         return; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     writeFileSync(path + ".license_info.json", JSON.stringify(li, null, "  ")) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | function cleanLicenseInfo(allPaths: string[], allLicenseInfos: SmallLicense[]) { | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |     // Read the license info file from the generated assets, creates a compiled license info in every directory
 | 
					
						
							|  |  |  |     // Note: this removes all the old license infos
 | 
					
						
							|  |  |  |     for (const licensePath of licensePaths) { | 
					
						
							|  |  |  |         unlinkSync(licensePath) | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |     const perDirectory = new Map<string, SmallLicense[]>() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     for (const license of allLicenseInfos) { | 
					
						
							|  |  |  |         const p = license.path | 
					
						
							|  |  |  |         const dir = p.substring(0, p.lastIndexOf("/")) | 
					
						
							|  |  |  |         license.path = p.substring(dir.length + 1) | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  |         if (!perDirectory.has(dir)) { | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |             perDirectory.set(dir, []) | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-09-09 00:05:51 +02:00
										 |  |  |         const cloned: SmallLicense = { | 
					
						
							| 
									
										
										
										
											2021-09-08 01:53:37 +02:00
										 |  |  |             // We make a clone to force the order of the keys
 | 
					
						
							|  |  |  |             path: license.path, | 
					
						
							|  |  |  |             license: license.license, | 
					
						
							|  |  |  |             authors: license.authors, | 
					
						
							|  |  |  |             sources: license.sources | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         perDirectory.get(dir).push(cloned) | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |     perDirectory.forEach((licenses, dir) => { | 
					
						
							| 
									
										
										
										
											2021-11-07 15:03:03 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  |         for (let i = licenses.length - 1; i >= 0; i--) { | 
					
						
							| 
									
										
										
										
											2021-11-07 15:03:03 +01:00
										 |  |  |             const license = licenses[i]; | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  |             const path = dir + "/" + license.path | 
					
						
							|  |  |  |             if (!existsSync(path)) { | 
					
						
							| 
									
										
										
										
											2021-11-07 15:03:03 +01:00
										 |  |  |                 console.log("Found license for now missing file: ", path, " - removing this license") | 
					
						
							|  |  |  |                 licenses.splice(i, 1) | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-08 01:53:37 +02:00
										 |  |  |         licenses.sort((a, b) => a.path < b.path ? -1 : 1) | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  |         writeFileSync(dir + "/license_info.json", JSON.stringify(licenses, null, 2)) | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  |     }) | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | function queryMissingLicenses(missingLicenses: string[]) { | 
					
						
							| 
									
										
										
										
											2021-04-10 14:25:06 +02:00
										 |  |  |     process.on('SIGINT', function () { | 
					
						
							|  |  |  |         console.log("Aborting... Bye!"); | 
					
						
							|  |  |  |         process.exit(); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     let i = 1; | 
					
						
							|  |  |  |     for (const missingLicens of missingLicenses) { | 
					
						
							|  |  |  |         console.log(i + " / " + missingLicenses.length) | 
					
						
							|  |  |  |         i++; | 
					
						
							|  |  |  |         if (i < missingLicenses.length - 5) { | 
					
						
							|  |  |  |             //    continue
 | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         createLicenseInfoFor(missingLicens) | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     console.log("You're through!") | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-04-10 13:57:16 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Creates the humongous license_info in the generated assets, containing all licenses with a path relative to the root | 
					
						
							|  |  |  |  * @param licensePaths | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | function createFullLicenseOverview(licensePaths) { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     const allLicenses: SmallLicense[] = [] | 
					
						
							|  |  |  |     for (const licensePath of licensePaths) { | 
					
						
							|  |  |  |         const licenses = <SmallLicense[]>JSON.parse(readFileSync(licensePath, "UTF-8")) | 
					
						
							|  |  |  |         for (const license of licenses) { | 
					
						
							| 
									
										
										
										
											2022-02-09 22:37:21 +01:00
										 |  |  |             validateLicenseInfo(license) | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  |             const dir = licensePath.substring(0, licensePath.length - "license_info.json".length) | 
					
						
							|  |  |  |             license.path = dir + license.path | 
					
						
							|  |  |  |             allLicenses.push(license) | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     writeFileSync("./assets/generated/license_info.json", JSON.stringify(allLicenses, null, "  ")) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | console.log("Checking and compiling license info") | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  | if (!existsSync("./assets/generated")) { | 
					
						
							|  |  |  |     mkdirSync("./assets/generated") | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-04 00:45:22 +01:00
										 |  |  | let contents = ScriptUtils.readDirRecSync("./assets") | 
					
						
							|  |  |  |     .filter(entry => entry.indexOf("./assets/generated") != 0) | 
					
						
							|  |  |  | let licensePaths = contents.filter(entry => entry.indexOf("license_info.json") >= 0) | 
					
						
							|  |  |  | let licenseInfos = generateLicenseInfos(licensePaths); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-06 04:06:02 +01:00
										 |  |  | const artwork = contents.filter(pth => pth.match(/(.svg|.png|.jpg|.ttf|.otf|.woff)$/i) != null) | 
					
						
							| 
									
										
										
										
											2021-04-07 01:32:39 +02:00
										 |  |  | const missingLicenses = missingLicenseInfos(licenseInfos, artwork) | 
					
						
							| 
									
										
										
										
											2022-02-04 00:45:22 +01:00
										 |  |  | if (process.argv.indexOf("--prompt") >= 0 || process.argv.indexOf("--query") >= 0) { | 
					
						
							|  |  |  |     queryMissingLicenses(missingLicenses) | 
					
						
							|  |  |  |     contents = ScriptUtils.readDirRecSync("./assets") | 
					
						
							|  |  |  |         .filter(entry => entry.indexOf("./assets/generated") != 0) | 
					
						
							|  |  |  |     licensePaths = contents.filter(entry => entry.indexOf("license_info.json") >= 0) | 
					
						
							|  |  |  |     licenseInfos = generateLicenseInfos(licensePaths); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-11 14:11:02 +02:00
										 |  |  | const invalidLicenses = licenseInfos.filter(l => (l.license ?? "") === "").map(l => `License for artwork ${l.path} is empty string or undefined`) | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  | for (const licenseInfo of licenseInfos) { | 
					
						
							|  |  |  |     for (const source of licenseInfo.sources) { | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |         if (source == "") { | 
					
						
							|  |  |  |             invalidLicenses.push("Invalid license: empty string in " + JSON.stringify(licenseInfo)) | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |         try { | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  |             new URL(source); | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |         } catch { | 
					
						
							|  |  |  |             invalidLicenses.push("Not a valid URL: " + source) | 
					
						
							| 
									
										
										
										
											2021-04-23 16:52:20 +02:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2022-02-04 00:45:22 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  | if (missingLicenses.length > 0) { | 
					
						
							| 
									
										
										
										
											2021-04-11 14:11:02 +02:00
										 |  |  |     const msg = `There are ${missingLicenses.length} licenses missing and ${invalidLicenses.length} invalid licenses.` | 
					
						
							| 
									
										
										
										
											2021-05-07 02:06:08 +02:00
										 |  |  |     console.log(missingLicenses.concat(invalidLicenses).join("\n")) | 
					
						
							| 
									
										
										
										
											2021-04-10 16:18:29 +02:00
										 |  |  |     console.error(msg) | 
					
						
							| 
									
										
										
										
											2021-04-11 01:58:51 +02:00
										 |  |  |     if (process.argv.indexOf("--no-fail") < 0) { | 
					
						
							| 
									
										
										
										
											2021-04-10 15:01:28 +02:00
										 |  |  |         throw msg | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-04-10 01:18:17 +02:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-10 15:01:28 +02:00
										 |  |  | cleanLicenseInfo(licensePaths, licenseInfos) | 
					
						
							| 
									
										
										
										
											2021-11-07 15:16:28 +01:00
										 |  |  | createFullLicenseOverview(licensePaths) |