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)) + } }) }