Skip to content

Commit

Permalink
- Enhancement: Add config to be able to disable npm ls error aborting
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed Mar 26, 2020
1 parent 9662e3c commit 844886c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function licensee (configuration, path, callback) {
outputError = error
})
child.once('close', function (code) {
if (code !== 0) {
if (!configuration.disableLsErrorAborting && code !== 0) {
done(new Error('npm exited with status ' + code))
} else if (outputError) {
done(outputError)
Expand Down
2 changes: 2 additions & 0 deletions licensee
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var USAGE = [
' --osi Permit licenses approved by the Open Source Initiative.',
' --packages LIST Permit comma-delimited name@range.',
' --errors-only Only show NOT APPROVED packages.',
' --disable-ls-error-aborting Disables aborting upon `npm ls` errors (as may occur due to missing peerDeps)',
' --production Do not check devDependencies.',
' --ndjson Print newline-delimited JSON objects.',
' --quiet Quiet mode, only exit(0/1).',
Expand Down Expand Up @@ -117,6 +118,7 @@ if (options['--init']) {
function checkDependencies () {
configuration.productionOnly = options['--production']
configuration.corrections = configuration.corrections || options['--corrections']
configuration.disableLsErrorAborting = options['--disable-ls-error-aborting']
require('./')(configuration, cwd, function (error, dependencies) {
if (error) {
die(error.message + '\n')
Expand Down

0 comments on commit 844886c

Please sign in to comment.