mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Merge pull request #262 from AikidoSec/safe-chain-verify-command
Add command to verify safe-chain is intercepting the package managers commands
This commit is contained in:
commit
74c57cd86a
3 changed files with 32 additions and 3 deletions
|
|
@ -13,6 +13,10 @@ import { getAuditStats } from "./scanning/audit/index.js";
|
|||
* @returns {Promise<number>}
|
||||
*/
|
||||
export async function main(args) {
|
||||
if (isSafeChainVerify(args)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
process.on("SIGINT", handleProcessTermination);
|
||||
process.on("SIGTERM", handleProcessTermination);
|
||||
|
||||
|
|
@ -104,3 +108,12 @@ export async function main(args) {
|
|||
function handleProcessTermination() {
|
||||
ui.writeBufferedLogsAndStopBuffering();
|
||||
}
|
||||
|
||||
/** @param {string[]} args */
|
||||
function isSafeChainVerify(args) {
|
||||
const safeChainCheckCommand = "safe-chain-verify";
|
||||
if (args.length > 0 && args[0] === safeChainCheckCommand) {
|
||||
ui.writeInformation("OK: Safe-chain works!");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue