mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Some more cleanup
This commit is contained in:
parent
41fda7f6ed
commit
38d3b46939
4 changed files with 5 additions and 4 deletions
|
|
@ -29,6 +29,7 @@ if (targetVersionMajor && String(targetVersionMajor).trim() === "3") {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set eco system
|
// Set eco system
|
||||||
|
// This can be used in other parts of the code to determine which eco system we are working with
|
||||||
setEcoSystem("py");
|
setEcoSystem("py");
|
||||||
|
|
||||||
initializePackageManager(packageManagerName);
|
initializePackageManager(packageManagerName);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export function getPipCommandForArgs(args) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The first non-flag argument is typically the command
|
// The first non-flag argument is the command
|
||||||
for (const arg of args) {
|
for (const arg of args) {
|
||||||
if (!arg.startsWith("-")) {
|
if (!arg.startsWith("-")) {
|
||||||
return arg;
|
return arg;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,8 @@ export async function auditChanges(changes) {
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const change of changes) {
|
for (const change of changes) {
|
||||||
console.log(" Safe-chain: auditing package:", change);
|
//Uncomment next line during manual testing
|
||||||
|
//console.log(" Safe-chain: auditing package:", change);
|
||||||
const malwarePackage = malwarePackages.find(
|
const malwarePackage = malwarePackages.find(
|
||||||
(pkg) => pkg.name === change.name && pkg.version === change.version
|
(pkg) => pkg.name === change.name && pkg.version === change.version
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,7 @@ async function getMalwareDatabase() {
|
||||||
|
|
||||||
function isMalwareStatus(status) {
|
function isMalwareStatus(status) {
|
||||||
let malwareStatus = status.toUpperCase();
|
let malwareStatus = status.toUpperCase();
|
||||||
return malwareStatus === MALWARE_STATUS_MALWARE
|
return malwareStatus === MALWARE_STATUS_MALWARE;
|
||||||
|| malwareStatus === MALWARE_STATUS_TELEMETRY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const MALWARE_STATUS_OK = "OK";
|
export const MALWARE_STATUS_OK = "OK";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue