From f479b36da5e220b07b2e1e7a3b29ef851e08fd7b Mon Sep 17 00:00:00 2001 From: Jago de Vreede Date: Fri, 12 Jul 2024 10:07:42 +0200 Subject: [PATCH] fix: bundled software not found --- sdkman-bundled-software/pom.xml | 2 +- .../github/jagodevreede/sdkmanui/bundle/BundledSoftware.java | 4 +--- .../io/github/jagodevreede/sdkmanui/ConfigurationUtil.java | 2 ++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdkman-bundled-software/pom.xml b/sdkman-bundled-software/pom.xml index 0971723..12cdb01 100644 --- a/sdkman-bundled-software/pom.xml +++ b/sdkman-bundled-software/pom.xml @@ -120,7 +120,7 @@ make-assembly - package + compile single diff --git a/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java b/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java index 3edfa4c..0d48c3d 100644 --- a/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java +++ b/sdkman-bundled-software/src/main/java/io/github/jagodevreede/sdkmanui/bundle/BundledSoftware.java @@ -18,9 +18,7 @@ public static InputStream getSoftwareStream() { public static void extract(File destinationFolder) throws IOException { InputStream softwareStream = getSoftwareStream(); - if (softwareStream == null) { - return; - } + destinationFolder.mkdirs(); // extract zip file byte[] buffer = new byte[1024]; ZipInputStream zis = new ZipInputStream(softwareStream); diff --git a/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java b/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java index 148cae7..c05ce55 100644 --- a/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java +++ b/sdkman-ui/src/main/java/io/github/jagodevreede/sdkmanui/ConfigurationUtil.java @@ -25,7 +25,9 @@ public final class ConfigurationUtil { static boolean preCheck(Stage stage) throws IOException { SdkManUiPreferences sdkManUiPreferences = ServiceRegistry.INSTANCE.getSdkManUiPreferences(); if (!sdkManUiPreferences.donePreCheck) { + logger.debug("Pre-check not done, checking"); if (BundledSoftware.getSoftwareStream() != null) { + logger.info("Extracting bundled software"); File installFolder = new File(ServiceRegistry.INSTANCE.getApi().getBaseFolder(), "ui" + separator + "3rdparty"); FileUtil.deleteRecursively(installFolder); BundledSoftware.extract(installFolder.getParentFile());