From 1f12f1a28b970b611c64d697fe7d7e07fb2fe9ac Mon Sep 17 00:00:00 2001 From: pratik Date: Tue, 21 Oct 2025 09:22:02 -0500 Subject: [PATCH] Modify path --- .claude/settings.local.json | 3 ++- .../java/com/cfdeployer/service/CfCliService.java | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 1f2cf22..5d149f2 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -5,7 +5,8 @@ "Bash(echo:*)", "Bash(gradle wrapper:*)", "Bash(./gradlew build:*)", - "Bash(./gradlew clean build:*)" + "Bash(./gradlew clean build:*)", + "Bash(jar:*)" ], "deny": [], "ask": [] diff --git a/src/main/java/com/cfdeployer/service/CfCliService.java b/src/main/java/com/cfdeployer/service/CfCliService.java index ffd47b5..47e1ef2 100644 --- a/src/main/java/com/cfdeployer/service/CfCliService.java +++ b/src/main/java/com/cfdeployer/service/CfCliService.java @@ -199,24 +199,25 @@ public class CfCliService { } String os = getOperatingSystem(); - String executable = os.equals("windows") ? "cf.exe" : "cf"; + // CF CLI v8 uses cf8/cf8.exe as the executable name + String executable = os.equals("windows") ? "cf8.exe" : "cf8"; log.info("Detected operating system: {}", os); - log.debug("CF CLI executable name: {}", executable); + log.info("CF CLI executable name: {}", executable); String resourcePath = String.format("/cf-cli/%s/%s", os, executable); File tempFile = File.createTempFile("cf-cli-", os.equals("windows") ? ".exe" : ""); tempFile.deleteOnExit(); - log.debug("Extracting CF CLI from resource path: {}", resourcePath); + log.info("Extracting CF CLI from resource path: {}", resourcePath); try (var inputStream = getClass().getResourceAsStream(resourcePath)) { if (inputStream == null) { log.error("CF CLI binary not found in resources for OS: {}. Expected path: {}", os, resourcePath); throw new IOException("CF CLI binary not found for OS: " + os + " at path: " + resourcePath); } - Files.copy(inputStream, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); - log.debug("CF CLI extracted to temporary file: {}", tempFile.getAbsolutePath()); + long bytesCopied = Files.copy(inputStream, tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + log.info("CF CLI extracted to temporary file: {} ({} bytes)", tempFile.getAbsolutePath(), bytesCopied); } if (!os.equals("windows")) { @@ -225,10 +226,10 @@ public class CfCliService { perms.add(PosixFilePermission.OWNER_WRITE); perms.add(PosixFilePermission.OWNER_EXECUTE); Files.setPosixFilePermissions(tempFile.toPath(), perms); - log.debug("Set executable permissions on CF CLI binary"); + log.info("Set executable permissions on CF CLI binary"); } - log.info("Using CF CLI executable: {}", tempFile.getAbsolutePath()); + log.info("Successfully prepared CF CLI executable: {}", tempFile.getAbsolutePath()); return tempFile.getAbsolutePath(); }