mirror of
https://github.com/AikidoSec/safe-chain.git
synced 2026-05-26 12:10:49 +00:00
Scaffold safe-chain-bun setup command
This commit is contained in:
parent
8f6742504f
commit
59762d2472
4 changed files with 80 additions and 11 deletions
41
packages/safe-chain-bun/bin/safe-chain-bun.js
Executable file
41
packages/safe-chain-bun/bin/safe-chain-bun.js
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
// Placeholder for setup function - will be implemented in next step
|
||||
function setup(configFile) {
|
||||
console.log("Setup functionality coming soon...");
|
||||
console.log("Target config file:", configFile || "~/.bunfig.toml");
|
||||
}
|
||||
|
||||
if (process.argv.length < 3) {
|
||||
console.error("No command provided. Please provide a command to execute.");
|
||||
console.log();
|
||||
writeHelp();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const command = process.argv[2];
|
||||
|
||||
if (command === "help" || command === "--help" || command === "-h") {
|
||||
writeHelp();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (command === "setup") {
|
||||
const configFile = process.argv[3];
|
||||
setup(configFile);
|
||||
} else {
|
||||
console.error(`Unknown command: ${command}.`);
|
||||
console.log();
|
||||
writeHelp();
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
function writeHelp() {
|
||||
console.log("Usage: safe-chain-bun <command>");
|
||||
console.log();
|
||||
console.log("Available commands: setup, help");
|
||||
console.log();
|
||||
console.log("- safe-chain-bun setup: Register Safe-Chain-Bun as a security scanner in ~/.bunfig.toml");
|
||||
console.log("- safe-chain-bun setup <file>: Register Safe-Chain-Bun as a security scanner in specified bunfig.toml file");
|
||||
console.log();
|
||||
}
|
||||
|
|
@ -3,6 +3,9 @@
|
|||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"main": "src/index.js",
|
||||
"bin": {
|
||||
"safe-chain-bun": "bin/safe-chain-bun.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node --test --experimental-test-module-mocks 'src/**/*.spec.js'"
|
||||
},
|
||||
|
|
@ -12,7 +15,13 @@
|
|||
"default": "./src/index.js"
|
||||
}
|
||||
},
|
||||
"keywords": ["bun", "security", "scanner", "malware", "aikido"],
|
||||
"keywords": [
|
||||
"bun",
|
||||
"security",
|
||||
"scanner",
|
||||
"malware",
|
||||
"aikido"
|
||||
],
|
||||
"author": "Aikido Security",
|
||||
"license": "AGPL-3.0-or-later",
|
||||
"description": "Aikido Security Scanner for Bun package manager - detects malware and security threats during package installation",
|
||||
|
|
@ -27,4 +36,4 @@
|
|||
"peerDependencies": {
|
||||
"bun": ">=1.2.21"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue