diff --git a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/BunInstaller.java b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/BunInstaller.java index ad1becc69..cd5a34e40 100644 --- a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/BunInstaller.java +++ b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/BunInstaller.java @@ -111,9 +111,10 @@ private void installBunDefault() throws InstallationException { // We need to delete the existing bun directory first so we clean out any old files, and // so we can rename the package directory below. + File bunExtractDirectory = new File(installDirectory, createBunTargetArchitecturePath()); try { - if (installDirectory.isDirectory()) { - FileUtils.deleteDirectory(installDirectory); + if (bunExtractDirectory.isDirectory()) { + FileUtils.deleteDirectory(bunExtractDirectory); } } catch (IOException e) { logger.warn("Failed to delete existing Bun installation.");