From c1c070bc6b959a8cb31f3659821bd6b8c3124851 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Wed, 20 Sep 2017 13:52:47 -0300 Subject: [PATCH 1/3] fix: data duplication to the output. --- bin/cli.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/cli.js b/bin/cli.js index ea72ba6..eb504f8 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -67,6 +67,11 @@ function addLicenseEntryIgnoreVersionRange (xmlElement, identifier, json, option xmlElement.dependencies.dependency.push(entry(json[key], nameVersion, options)); } } + xmlElement.dependencies.dependency = xmlElement.dependencies.dependency + .filter((d, index, self) => self.findIndex((t) => { + console.log(t.licenses.license.length); + return t.version === d.version && t.licenses.license[0].name === d.licenses.license[0].name; + }) === index); return xmlElement; } From 6f9214b6bd64facec8fb8c1108f038c5b86a57a0 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Wed, 20 Sep 2017 13:55:31 -0300 Subject: [PATCH 2/3] src: cleanup console.log --- bin/cli.js | 1 - 1 file changed, 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index eb504f8..ade492a 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -69,7 +69,6 @@ function addLicenseEntryIgnoreVersionRange (xmlElement, identifier, json, option } xmlElement.dependencies.dependency = xmlElement.dependencies.dependency .filter((d, index, self) => self.findIndex((t) => { - console.log(t.licenses.license.length); return t.version === d.version && t.licenses.license[0].name === d.licenses.license[0].name; }) === index); return xmlElement; From 160385e99a9f61baba3440ae1a61a859eb98bca9 Mon Sep 17 00:00:00 2001 From: Helio Frota <00hf11@gmail.com> Date: Wed, 20 Sep 2017 13:58:48 -0300 Subject: [PATCH 3/3] fix: hide the messager when using ignore-version-range --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index ade492a..8bcae1f 100644 --- a/bin/cli.js +++ b/bin/cli.js @@ -124,7 +124,7 @@ function showWarnings (options, declaredDependencies, xmlObject) { .filter(e1 => xmlObjectDependencies .filter(e2 => e2 === e1) .length === 0); - if (missingDependencies.length > 0) { + if (missingDependencies.length > 0 && !options.ignoreVersionRange) { console.log(`Dependencies found in package.json but not in xml: ${missingDependencies.join(',')}`); console.log(`Please run 'license-reporter --ignore-version-range' to show all declared dependencies on generated xml.`); }