codeprobe-scanner 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { execSync } = require('child_process');
4
+ const path = require('path');
5
+ const fs = require('fs');
6
+ const os = require('os');
7
+
8
+ // Get the package root directory
9
+ const packageRoot = path.resolve(__dirname, '..');
10
+
11
+ // Try to find bun
12
+ function findBun() {
13
+ try {
14
+ // Try system bun
15
+ execSync('bun --version', { stdio: 'pipe' });
16
+ return 'bun';
17
+ } catch (e) {
18
+ // Try home directory
19
+ const bunPath = path.join(os.homedir(), '.bun', 'bin', 'bun');
20
+ if (fs.existsSync(bunPath)) {
21
+ return bunPath;
22
+ }
23
+ return null;
24
+ }
25
+ }
26
+
27
+ // Find or install bun
28
+ let bunCmd = findBun();
29
+ if (!bunCmd) {
30
+ console.error('❌ Bun is not installed.');
31
+ console.error('Installing Bun...');
32
+ try {
33
+ execSync('curl -fsSL https://bun.sh/install | bash', { stdio: 'inherit' });
34
+ bunCmd = path.join(os.homedir(), '.bun', 'bin', 'bun');
35
+ } catch (err) {
36
+ console.error('Failed to install Bun. Please install manually: https://bun.sh');
37
+ process.exit(1);
38
+ }
39
+ }
40
+
41
+ // Run the CLI
42
+ const args = process.argv.slice(2);
43
+ const cmd = `${bunCmd} run ${path.join(packageRoot, 'src/cli-server.ts')} ${args.join(' ')}`;
44
+
45
+ try {
46
+ execSync(cmd, {
47
+ stdio: 'inherit',
48
+ cwd: packageRoot
49
+ });
50
+ } catch (err) {
51
+ process.exit(err.status || 1);
52
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "codeprobe-scanner",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Automated vulnerability scanner with exploit verification and video evidence",
5
5
  "type": "module",
6
6
  "bin": {
7
- "codeprobe": "bin/codeprobe.js"
7
+ "codeprobe": "bin/codeprobe.cjs"
8
8
  },
9
9
  "publishConfig": {
10
10
  "access": "public"
package/bin/codeprobe.js DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const { spawn } = require('child_process');
4
- const path = require('path');
5
-
6
- // Get the package root directory
7
- const packageRoot = path.resolve(__dirname, '..');
8
-
9
- // Run bun with the CLI
10
- const args = process.argv.slice(2);
11
- const child = spawn('bun', ['run', path.join(packageRoot, 'src/cli-server.ts'), ...args], {
12
- stdio: 'inherit',
13
- shell: true,
14
- });
15
-
16
- child.on('exit', (code) => {
17
- process.exit(code);
18
- });