diff --git a/README.md b/README.md index 00e98c0..5cf817a 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ You could see something like this: - `--excludeLicenses [list]` exclude modules which licenses are in the comma-separated list from the output - `--includeLicenses [list]` include only modules which licenses are in the comma-separated list from the output - `--relativeLicensePath` output the location of the license files as relative paths +- `--relativeModulePath` output the location of the module files as relative paths - `--summary` output a summary of the license usage', - `--failOn [list]` fail (exit with code 1) on the first occurrence of the licenses of the semicolon-separated list - `--onlyAllow [list]` fail (exit with code 1) on the first occurrence of the licenses not in the semicolon-seperated list diff --git a/bin/license-checker-rseidelsohn b/bin/license-checker-rseidelsohn index d70f53c..07e1e5e 100644 --- a/bin/license-checker-rseidelsohn +++ b/bin/license-checker-rseidelsohn @@ -33,6 +33,7 @@ if (args.help) { ' --excludeLicenses [list] exclude modules which licenses are in the comma-separated list from the output', ' --includeLicenses [list] include only modules which licenses are in the comma-separated list from the output', ' --relativeLicensePath output the location of the license files as relative paths', + ' --relativeModulePath output the location of the module files as relative paths', ' --summary output a summary of the license usage', ' --failOn [list] fail (exit with code 1) on the first occurrence of the licenses of the semicolon-separated list', ' --onlyAllow [list] fail (exit with code 1) on the first occurrence of the licenses not in the semicolon-seperated list', diff --git a/lib/index.js b/lib/index.js index 04a492e..42420e9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -284,6 +284,9 @@ const flatten = function flatten(options) { }; exports.init = function init(args, callback) { + // Fix path if on Windows: + const workingDir = args.start.replace(/\\\\/g, '\\'); + debugLog('scanning %s', args.start); if (args.customPath) { @@ -516,6 +519,11 @@ exports.init = function init(args, callback) { } /*istanbul ignore else*/ if (data[item]) { + if (args.relativeModulePath && data[item].path) { + // Cut the absolute portion of the module path (for forward and backward slashes respectively): + data[item].path = data[item].path.replace(`${workingDir}/`, '').replace(`${workingDir}\\`, ''); + } + if (args.onlyunknown) { if (data[item].licenses.indexOf('*') > -1 || data[item].licenses.indexOf(UNKNOWN) > -1) { sorted[item] = data[item]; diff --git a/package.json b/package.json index 999ea30..5cc0998 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ "Peter Uithoven ", "Philipp Tusch ", "Rogier Schouten ", - "Roman Seidelsohn ", "Roman Seidelsohn ", "Roman Seidelsohn ", "Stan Senotrusov ", diff --git a/scripts/contrib.js b/scripts/contrib.js index 7fefe1f..8d0fb8c 100755 --- a/scripts/contrib.js +++ b/scripts/contrib.js @@ -7,7 +7,60 @@ const opts = join(__dirname, '../'); const pkg = join(__dirname, '../package.json'); const json = require(pkg); -json.contributors = []; //clear it +json.contributors = [ + 'Adam Weber ', + 'Andrew Couch ', + 'Asharma ', + 'Bryan English ', + 'Christoph Werner ', + 'Cory Reed ', + 'Damien Larmine ', + 'Dan Rumney ', + 'Dav Glass ', + 'Dick Wiggers ', + 'Drew Folta ', + 'Elijah Insua ', + 'Francois Zaninotto ', + 'Glen Arrowsmith ', + 'Helio Frota <00hf11@gmail.com>', + 'Holger Knust ', + 'Honza Javorek ', + 'Ivan Latunov ', + 'James Bloomer ', + 'Jonny Reeves ', + 'Jonny Reeves ', + 'Ladislav Prskavec ', + 'Ladislav Prskavec ', + 'Lorenzo Cesana ', + 'Mark Tse ', + 'Mark Tse ', + 'Mattias Amnefelt ', + 'Michael Kühnel ', + 'Michael Williamson ', + 'Paul Mandel ', + 'Peter Uithoven ', + 'Philipp Tusch ', + 'Rogier Schouten ', + 'Roman Seidelsohn ', + 'Stan Senotrusov ', + 'Stoyan Revov ', + 'Tero Keski-Valkama ', + 'Thomas Grainger ', + 'Tim Brust ', + 'Tim Oxley ', + 'Timothée Mazzucotelli ', + 'Tobi ', + 'Tobias Büschel ', + 'Yukari Ishibashi ', + 'Yuri Zapuchlak ', + 'badunk ', + 'creising ', + 'gdw2 ', + 'ktmouk ', + 'santiagocanti ', + 'tbbstny ', + 'zodiac403 ', +]; //clear it GitContributors.list(opts, function(err, result) { result.forEach(function(item) {