From d67eb8ce4e9c98d66994e1c576627169c9e1b8fb Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 18 Jun 2024 16:54:19 +0200 Subject: [PATCH] chore: Adjust SPDX tool to multiple line licenses instead of `AND` chained Signed-off-by: Ferdinand Thiessen --- build/WebpackSPDXPlugin.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/build/WebpackSPDXPlugin.js b/build/WebpackSPDXPlugin.js index e9eeccca0f1..82ccfabf173 100644 --- a/build/WebpackSPDXPlugin.js +++ b/build/WebpackSPDXPlugin.js @@ -198,8 +198,11 @@ class WebpackSPDXPlugin { authors.add(pkg.author) output += `\n- ${pkg.name}\n\t- version: ${pkg.version}\n\t- license: ${license}` } - output += `\n\nSPDX-License-Identifier: ${[...licenses].sort().join(' AND ')}\n` - output += [...authors].sort().map((author) => `SPDX-FileCopyrightText: ${author}`).join('\n'); + output += '\n\n' + for (const license of [...licenses].sort()) { + output += `SPDX-License-Identifier: ${license}\n` + } + output += [...authors].sort().map((author) => `SPDX-FileCopyrightText: ${author}`).join('\n') compilation.emitAsset( asset.split('?', 2)[0] + '.license', @@ -208,9 +211,10 @@ class WebpackSPDXPlugin { } if (callback) { - return void callback() + return callback() } } + } -module.exports = WebpackSPDXPlugin; +module.exports = WebpackSPDXPlugin