Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: set audit exit code properly #3311

Merged
merged 1 commit into from
May 26, 2021

Commits on May 26, 2021

  1. fix: set audit exit code properly

    When running 'npm audit', we properly exited correctly with the
    appropriate exitCode based on the audit level config and the report
    results.
    
    However, when going through the reifyFinish() function (as we do for
    'npm audit fix'), we were not setting that properly if the auditLevel
    was not set.
    
    Furthermore, if the auditLevel WAS set, we were setting the exit code to
    non-zero for *other* reify commands (install, update, etc.), where the
    audit information should be strictly advisory.
    
    When --json and --loglevel=silent were set, the exitCode was never being
    set properly.
    
    This fixes all these problems.
    
    PR-URL: #3311
    Credit: @isaacs
    Close: #3311
    Reviewed-by: @wraithgar
    isaacs authored and wraithgar committed May 26, 2021
    Configuration menu
    Copy the full SHA
    554e8a5 View commit details
    Browse the repository at this point in the history