Handle PR Comments

This commit is contained in:
Sander Declerck 2025-10-08 10:49:04 +02:00
parent ea383a18de
commit 240123372a
No known key found for this signature in database
5 changed files with 24 additions and 14 deletions

View file

@ -65,8 +65,7 @@ export async function scanCommand(args) {
return 0;
} else {
printMaliciousChanges(audit.disallowedChanges, spinner);
await onMalwareFound();
return 1;
return await onMalwareFound();
}
}
@ -90,11 +89,11 @@ async function onMalwareFound() {
if (continueInstall) {
ui.writeWarning("Continuing with the installation despite the risks...");
return;
return 0;
}
}
ui.writeError("Exiting without installing malicious packages.");
ui.emptyLine();
process.exit(1);
return 1;
}

View file

@ -31,6 +31,8 @@ export async function openMalwareDatabase() {
return packageData.reason;
}
// This implicitely caches the malware database
// that's closed over by the getPackageStatus function
cachedMalwareDatabase = {
getPackageStatus,
isMalware: (name, version) => {