Skip to content

Commit

Permalink
feat: add command to check if license is SPDX compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
neodmy committed May 9, 2023
1 parent 3bce5c0 commit f07cfd2
Show file tree
Hide file tree
Showing 5 changed files with 6,663 additions and 3,943 deletions.
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ const checker = require('./src/checker');
const args = require('./src/args');
const middleware = require('./src/middleware');
const runner = require('./src/runner');
const spdxValidator = require('./src/spdx-validator');

(async () => {
try {
await runner.run(checker, middleware(args));
const parsedArgs = middleware(args);
if (args.checkLicense) {
const license = args.checkLicense.trim();
spdxValidator.isSpdxCompliant(license);
console.info(`License ${license} is SPDX compliant`);
return;
}

await runner.run(checker, parsedArgs);
console.info('License check completed! No forbidden licenses packages found.');
} catch (e) {
console.error(e.message);
Expand Down
Loading

0 comments on commit f07cfd2

Please sign in to comment.