Fix license checker.
This commit is contained in:
parent
fb88460247
commit
2b17905691
|
|
@ -58,7 +58,7 @@
|
|||
"eslint-config-prettier": "^2.6.0",
|
||||
"eslint-plugin-prettier": "^2.3.1",
|
||||
"jsdoc": "^3.3.3",
|
||||
"license-checker": "^5.1.2",
|
||||
"license-checker": "^14.0.0",
|
||||
"mocha": "^3.1.2",
|
||||
"node-sass": "^4.5.0",
|
||||
"prettier": "^1.7.2",
|
||||
|
|
|
|||
|
|
@ -5,13 +5,11 @@
|
|||
|
||||
const checker = require('license-checker');
|
||||
|
||||
const INCOMPATIBLE_LICENCE_REGEX = /GPL/;
|
||||
|
||||
checker.init(
|
||||
{
|
||||
start: '.'
|
||||
},
|
||||
function(json, err) {
|
||||
function(err, json) {
|
||||
if (err) {
|
||||
console.error(err.message);
|
||||
process.exit(1);
|
||||
|
|
@ -21,7 +19,18 @@ checker.init(
|
|||
|
||||
if (!Array.isArray(licenses)) licenses = [licenses];
|
||||
|
||||
if (licenses.find(license => license.match(INCOMPATIBLE_LICENCE_REGEX)))
|
||||
if (
|
||||
licenses
|
||||
.filter(
|
||||
license =>
|
||||
!(
|
||||
license.match(/LGPL/) ||
|
||||
license.match(/MIT/) ||
|
||||
license.match(/BSD/)
|
||||
)
|
||||
)
|
||||
.find(license => license.match(/GPL/))
|
||||
)
|
||||
return packageName;
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue