Skip to content

Commit

Permalink
chore: licence checker
Browse files Browse the repository at this point in the history
  • Loading branch information
medjedovicm committed Jul 7, 2023
1 parent 5f0ae58 commit c5434e9
Show file tree
Hide file tree
Showing 3 changed files with 545 additions and 0 deletions.
28 changes: 28 additions & 0 deletions licenseChecker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const licenseChecker = require('license-checker')

const check = (cwd) => {
return new Promise((resolve, reject) => {
licenseChecker.init(
{
production: true,
start: cwd,
excludePrivatePackages: true,
onlyAllow:
'AFLv2.1;Apache 2.0;Apache-2.0;Apache*;Artistic-2.0;0BSD;BSD*;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;MPL-2.0;ODC-By-1.0;Python-2.0;Unlicense;',
excludePackages:
'@cds/city@1.1.0'
},
(error, json) => {
if (error) {
reject(error)
} else {
resolve(json)
}
}
)
})
}

check(process.cwd(), true)
.then((res) => console.log('All packages are licensed properly'))
.catch((err) => console.log('license checker err', err))
Loading

0 comments on commit c5434e9

Please sign in to comment.