Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -421,33 +421,16 @@ public String checkEngineExist(@NonNull String engineName) throws CxException, I
}

private String verifyEngineOnMAC(String engineName,List<String>arguments) throws CxException, IOException, InterruptedException {
Exception lastException = null;
String enginePath;
// Try to verify engine exists via shell command
try{
enginePath= Execution.executeCommand((arguments), logger, line->line);
return enginePath;
Execution.executeCommand((arguments), logger, line->line);
} catch (CxException | IOException e) {
lastException = e;
// Log but don't fail - CLI will handle fallback path resolution
// This handles the case when IDE is launched via GUI (no PATH inherited)
this.logger.debug("Engine '{}' not found in PATH, CLI will try fallback paths", engineName);
}
Path dockerPath = Paths.get(CxConstants.DOCKER_FALLBACK_PATH);
Path podmanPath = Paths.get(CxConstants.PODMAN_FALLBACK_PATH);
if (CxConstants.DOCKER.equalsIgnoreCase(engineName)) {
if (Files.isSymbolicLink(dockerPath)) {
return Files.readSymbolicLink(dockerPath).toAbsolutePath().toString();
}
else { return dockerPath.toAbsolutePath().toString(); }
}
else if (CxConstants.PODMAN.equalsIgnoreCase(engineName)) {
if (Files.exists(podmanPath)) {
if (Files.isSymbolicLink(podmanPath)) {
return Files.readSymbolicLink(podmanPath).toAbsolutePath().toString();
}
else{
return podmanPath.toAbsolutePath().toString();
}
}
}
throw new CxException( 1, "Engine '" + engineName + "' is not installed or not symlinked to /usr/local/bin." );
// Always return just the engine name, let CLI resolve the actual path
return engineName;
}

private String checkEngine(String engineName, String osType ) throws CxException, IOException, InterruptedException {
Expand Down
Loading