From a5ac9f570996a783fcc3512019afd81a4fe65666 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 1 Feb 2023 16:33:01 -0800 Subject: [PATCH] Fix dropped argument in flatten recursion --- lib/index.js | 5 ++++- tests/clarificationFile-test.js | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 89573e7..da737c3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -212,6 +212,7 @@ const flatten = function flatten(options) { process.exit(1); } + /*istanbul ignore else*/ if (!content) { content = fs.readFileSync(licenseFile, { encoding: 'utf8' }); } @@ -219,7 +220,7 @@ const flatten = function flatten(options) { let sha256 = createHash('sha256').update(content).digest('hex'); if (clarification.checksum !== sha256) { - console.error(`Clarification checksum mismatch for ${key} :(`); + console.error(`Clarification checksum mismatch for ${key} :(\nFile checked: ${licenseFile}`); process.exit(1); } else { passed_clarification_check = true; @@ -327,6 +328,7 @@ const flatten = function flatten(options) { production: options.production, unknown, depth: options.depth + 1, + clarifications: options.clarifications, }); }); } @@ -854,6 +856,7 @@ exports.asPlainVertical = function asPlainVertical(sorted) { return moduleLicense.type || moduleLicense.name; } + /*istanbul ignore next*/ if (typeof moduleLicense === 'string') { return moduleLicense; } diff --git a/tests/clarificationFile-test.js b/tests/clarificationFile-test.js index e968a7e..4d4b8fd 100644 --- a/tests/clarificationFile-test.js +++ b/tests/clarificationFile-test.js @@ -49,8 +49,8 @@ describe('clarifications', function() { cwd: path.join(__dirname, '../'), }); - license_checker.stderr.on('data', function(stdout) { - data += stdout.toString(); + license_checker.stderr.on('data', function(stderr) { + data += stderr.toString(); }); license_checker.on('exit', function(code) {