From 2eabfea8af22a3810487cdacd68d850f4432e624 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Wed, 14 Jun 2023 01:47:39 +0200 Subject: [PATCH] Fix: remove empty license files, fix #1135 --- scripts/generateLicenseInfo.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/generateLicenseInfo.ts b/scripts/generateLicenseInfo.ts index 7980e5493b..227e23f969 100644 --- a/scripts/generateLicenseInfo.ts +++ b/scripts/generateLicenseInfo.ts @@ -226,7 +226,13 @@ export class GenerateLicenseInfo extends Script { } licenses.sort((a, b) => (a.path < b.path ? -1 : 1)) - writeFileSync(dir + "/license_info.json", JSON.stringify(licenses, null, 2)) + const path = dir + "/license_info.json" + if(licenses.length === 0){ + console.log("Removing",path,"as it is empty") + // No need to _actually_ unlik, this is done above + }else{ + writeFileSync(path, JSON.stringify(licenses, null, 2)) + } }) }