From 7ce14ea7948638ca1dff4016126ff51a8e53e88c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alfredo=20Espa=C3=B1a?= Date: Mon, 4 Mar 2024 15:47:37 -0600 Subject: [PATCH] Fix small issue in tofu name logic (#47) --- .../main/java/org/terrakube/terraform/TerraformDownloader.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/terraform-client/src/main/java/org/terrakube/terraform/TerraformDownloader.java b/terraform-client/src/main/java/org/terrakube/terraform/TerraformDownloader.java index d397630..931f91c 100644 --- a/terraform-client/src/main/java/org/terrakube/terraform/TerraformDownloader.java +++ b/terraform-client/src/main/java/org/terrakube/terraform/TerraformDownloader.java @@ -268,11 +268,10 @@ public String downloadTofuVersion(String tofuVersion) throws IOException { for (TofuAsset asset : assets) { String[] parts = asset.getName().split("_"); String os = parts[2]; - String arch = parts[3]; + String arch = parts[3].replace(".zip",""); // we need to remove .zip from the asset name example: tofu_1.6.2_linux_amd64.zip if (doSystemAndReleaseMatch(arch, os)) { String zipReleaseURL = asset.getBrowser_download_url(); String fileName = String.format(defaultFileName, tofuVersion, getOs(), arch); - tofuFilePath = downloadFileOrReturnPathIfAlreadyExists(fileName, zipReleaseURL, tofuVersion, true); notFound = false; break;