From 1e43fec1c5bede80da249b4f2a0f5837da1dd42f Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 8 Jun 2023 01:23:19 -0400 Subject: [PATCH] Update buildLicenses to only include the theme url if there is one --- styles/src/buildLicenses.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/styles/src/buildLicenses.ts b/styles/src/buildLicenses.ts index 2e1325044d..13a6951a82 100644 --- a/styles/src/buildLicenses.ts +++ b/styles/src/buildLicenses.ts @@ -30,17 +30,19 @@ function generateLicenseFile(themes: ThemeConfig[]) { checkLicenses(themes) for (const theme of themes) { const licenseText = fs.readFileSync(theme.licenseFile).toString() - writeLicense(theme.name, theme.licenseUrl, licenseText) + writeLicense(theme.name, licenseText, theme.licenseUrl) } } function writeLicense( themeName: string, - licenseUrl: string, - licenseText: String + licenseText: string, + licenseUrl?: string ) { process.stdout.write( - `## [${themeName}](${licenseUrl})\n\n${licenseText}\n********************************************************************************\n\n` + licenseUrl + ? `## [${themeName}](${licenseUrl})\n\n${licenseText}\n********************************************************************************\n\n` + : `## ${themeName}\n\n${licenseText}\n********************************************************************************\n\n` ) }