codeprobe-scanner 1.0.21 → 1.0.22
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/package.json +1 -1
- package/src/cli/commands/scan.ts +6 -3
package/package.json
CHANGED
package/src/cli/commands/scan.ts
CHANGED
|
@@ -166,7 +166,7 @@ async function undoLastChanges(): Promise<void> {
|
|
|
166
166
|
console.log(chalk.green("\n✓ Undo complete! Review changes with: git status"));
|
|
167
167
|
} catch (error) {
|
|
168
168
|
console.error(chalk.red(`✗ Undo failed: ${error instanceof Error ? error.message : String(error)}`));
|
|
169
|
-
process.
|
|
169
|
+
process.exitCode = EXIT_CODES.FAILURE;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -251,9 +251,12 @@ export async function scanCommand(args: string[]): Promise<void> {
|
|
|
251
251
|
await scanWithFixCommand([repoPath], report, logger);
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
//
|
|
254
|
+
// Set exit code based on vulnerabilities found
|
|
255
255
|
const hasVulnerabilities = report.scan.cves.length > 0;
|
|
256
|
-
|
|
256
|
+
const exitCode = hasVulnerabilities ? EXIT_CODES.VULNERABILITIES_FOUND : EXIT_CODES.SUCCESS;
|
|
257
|
+
|
|
258
|
+
// Exit gracefully with appropriate code
|
|
259
|
+
process.exitCode = exitCode;
|
|
257
260
|
} catch (error) {
|
|
258
261
|
handleError(error, logger, true);
|
|
259
262
|
}
|