license-checker
Advanced tools
Comparing version 2.0.2 to 3.0.0
@@ -67,16 +67,20 @@ | ||
moduleInfo.licenses = license(json.readme); | ||
} else { | ||
files = fs.readdirSync(json.path).filter(function(filename) { | ||
filename = filename.toUpperCase(); | ||
return filename.indexOf('LICENSE') > -1 || filename.indexOf('LICENCE') > -1 ; | ||
}); | ||
} | ||
files.forEach(function(filename) { | ||
licenseFile = path.join(json.path, filename); | ||
// Checking that the file is in fact a normal file and not a directory for example. | ||
if (fs.lstatSync(licenseFile).isFile()) { | ||
files = fs.readdirSync(json.path).filter(function(filename) { | ||
filename = filename.toUpperCase(); | ||
return filename.indexOf('LICENSE') > -1 || filename.indexOf('LICENCE') > -1 ; | ||
}); | ||
files.forEach(function(filename) { | ||
licenseFile = path.join(json.path, filename); | ||
// Checking that the file is in fact a normal file and not a directory for example. | ||
if (fs.lstatSync(licenseFile).isFile()) { | ||
if (moduleInfo.licenses.indexOf(UNKNOWN) > -1) { | ||
//Only re-check the license if we didn't get it from elsewhere | ||
moduleInfo.licenses = license(fs.readFileSync(licenseFile, {encoding: 'utf8'})); | ||
} | ||
}); | ||
} | ||
moduleInfo.licenseFile = licenseFile; | ||
} | ||
}); | ||
@@ -83,0 +87,0 @@ if (Array.isArray(moduleInfo.licenses)) { |
var MIT_LICENSE = /ermission is hereby granted, free of charge, to any/; | ||
var BSD_LICENSE = /edistribution and use in source and binary forms, with or without/; | ||
var BSD_LICENSE = /edistribution and use in source and binary forms, with or withou/; | ||
var MIT = /MIT\b/; | ||
@@ -4,0 +4,0 @@ var BSD = /BSD\b/; |
@@ -5,3 +5,3 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "2.0.2", | ||
"version": "3.0.0", | ||
"dependencies": { | ||
@@ -8,0 +8,0 @@ "chalk": "~0.5.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16881
332