Skip to content

Commit

Permalink
Fix dropped argument in flatten recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
mikayla-maki committed Feb 2, 2023
1 parent 97508d6 commit a5ac9f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,15 @@ const flatten = function flatten(options) {
process.exit(1);
}

/*istanbul ignore else*/
if (!content) {
content = fs.readFileSync(licenseFile, { encoding: 'utf8' });
}

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;
Expand Down Expand Up @@ -327,6 +328,7 @@ const flatten = function flatten(options) {
production: options.production,
unknown,
depth: options.depth + 1,
clarifications: options.clarifications,
});
});
}
Expand Down Expand Up @@ -854,6 +856,7 @@ exports.asPlainVertical = function asPlainVertical(sorted) {
return moduleLicense.type || moduleLicense.name;
}

/*istanbul ignore next*/
if (typeof moduleLicense === 'string') {
return moduleLicense;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/clarificationFile-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a5ac9f5

Please sign in to comment.