mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Only write to stdout when safe-chain audited packages
This commit is contained in:
parent
18f30ac66e
commit
e4c40330f7
3 changed files with 225 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ import { getPackageManager } from "./packagemanager/currentPackageManager.js";
|
|||
import { initializeCliArguments } from "./config/cliArguments.js";
|
||||
import { createSafeChainProxy } from "./registryProxy/registryProxy.js";
|
||||
import chalk from "chalk";
|
||||
import { getAuditStats } from "./scanning/audit/index.js";
|
||||
|
||||
/**
|
||||
* @param {string[]} args
|
||||
|
|
@ -61,12 +62,15 @@ export async function main(args) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
ui.emptyLine();
|
||||
ui.writeInformation(
|
||||
`${chalk.green(
|
||||
"✔"
|
||||
)} Safe-chain: Command completed, no malicious packages found.`
|
||||
);
|
||||
const auditStats = getAuditStats();
|
||||
if (auditStats.verifiedPackages > 0) {
|
||||
ui.emptyLine();
|
||||
ui.writeInformation(
|
||||
`${chalk.green("✔")} Safe-chain: Scanned ${
|
||||
auditStats.verifiedPackages
|
||||
} packages, no malware found.`
|
||||
);
|
||||
}
|
||||
|
||||
// Returning the exit code back to the caller allows the promise
|
||||
// to be awaited in the bin files and return the correct exit code
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue