codesentry 0.1.2 → 0.1.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.
- package/dist/index.js +9 -2
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -345,6 +345,7 @@ var runScan = async (targetDir, rules, concurrency = DEFAULT_SCAN_CONCURRENCY) =
|
|
|
345
345
|
|
|
346
346
|
// src/scanner/semgrep.ts
|
|
347
347
|
import { execFile } from "child_process";
|
|
348
|
+
import { delimiter, dirname as dirname2 } from "path";
|
|
348
349
|
import { promisify } from "util";
|
|
349
350
|
|
|
350
351
|
// src/scanner/semgrep-runtime.ts
|
|
@@ -445,11 +446,17 @@ var runBundledSemgrep = async (targetDir, runtime = resolveBundledSemgrepRuntime
|
|
|
445
446
|
"dist",
|
|
446
447
|
"--exclude",
|
|
447
448
|
".next",
|
|
448
|
-
targetDir
|
|
449
|
+
// Não repetir targetDir aqui: o processo já roda com cwd = targetDir
|
|
450
|
+
// (abaixo), então o alvo relativo a esse cwd é o diretório atual.
|
|
451
|
+
"."
|
|
449
452
|
];
|
|
450
453
|
let stdout;
|
|
454
|
+
const env = {
|
|
455
|
+
...process.env,
|
|
456
|
+
PATH: `${dirname2(runtime.semgrep)}${delimiter}${process.env.PATH ?? ""}`
|
|
457
|
+
};
|
|
451
458
|
try {
|
|
452
|
-
({ stdout } = await execute(runtime.semgrep, args, { cwd: targetDir, maxBuffer: 20 * 1024 * 1024 }));
|
|
459
|
+
({ stdout } = await execute(runtime.semgrep, args, { cwd: targetDir, maxBuffer: 20 * 1024 * 1024, env }));
|
|
453
460
|
} catch (error) {
|
|
454
461
|
const output = outputFromError(error);
|
|
455
462
|
if (!output) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codesentry",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"workspaces": [
|
|
5
5
|
"packages/semgrep-rules"
|
|
6
6
|
],
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@clack/prompts": "^1.7.0",
|
|
49
49
|
"chalk": "^6.0.0",
|
|
50
50
|
"cli-table3": "^0.6.5",
|
|
51
|
-
"codesentry-semgrep-rules": "0.1.
|
|
51
|
+
"codesentry-semgrep-rules": "0.1.4",
|
|
52
52
|
"commander": "^15.0.0",
|
|
53
53
|
"eslint": "^10.10.0",
|
|
54
54
|
"eslint-plugin-no-unsanitized": "^4.1.5",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"p-limit": "^7.3.2"
|
|
60
60
|
},
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"codesentry-semgrep-linux-x64": "0.1.
|
|
63
|
-
"codesentry-semgrep-win32-x64": "0.1.
|
|
62
|
+
"codesentry-semgrep-linux-x64": "0.1.4",
|
|
63
|
+
"codesentry-semgrep-win32-x64": "0.1.4"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/node": "^26.4.1",
|