From 69b781ab1162433659a3879cd88fa00fd362d848 Mon Sep 17 00:00:00 2001 From: jan-vcapgemini Date: Mon, 9 Dec 2024 13:45:03 +0100 Subject: [PATCH] #851: implemented requested changes added checks for idea and studio files as well als idea.sh and studio.sh --- .../tools/ide/tool/androidstudio/AndroidStudio.java | 11 ++++++++++- .../com/devonfw/tools/ide/tool/intellij/Intellij.java | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/androidstudio/AndroidStudio.java b/cli/src/main/java/com/devonfw/tools/ide/tool/androidstudio/AndroidStudio.java index 96d23e1d1..622ae6fcc 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/androidstudio/AndroidStudio.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/androidstudio/AndroidStudio.java @@ -1,5 +1,6 @@ package com.devonfw.tools.ide.tool.androidstudio; +import java.nio.file.Files; import java.util.Set; import com.devonfw.tools.ide.common.Tag; @@ -18,6 +19,8 @@ public class AndroidStudio extends IdeaBasedIdeToolCommandlet { private static final String STUDIO64_EXE = STUDIO + "64.exe"; + private static final String STUDIO_BASH_SCRIPT = STUDIO + ".sh"; + /** * The constructor. * @@ -34,7 +37,13 @@ protected String getBinaryName() { if (this.context.getSystemInfo().isWindows()) { return STUDIO64_EXE; } else { - return STUDIO; + if (Files.exists(this.getToolBinPath().resolve(STUDIO))) { + return STUDIO; + } else if (Files.exists(this.getToolBinPath().resolve(STUDIO_BASH_SCRIPT))) { + return STUDIO_BASH_SCRIPT; + } else { + return STUDIO; + } } } diff --git a/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java b/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java index 7315b1314..e0743d060 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java +++ b/cli/src/main/java/com/devonfw/tools/ide/tool/intellij/Intellij.java @@ -1,5 +1,6 @@ package com.devonfw.tools.ide.tool.intellij; +import java.nio.file.Files; import java.util.Set; import com.devonfw.tools.ide.common.Tag; @@ -19,6 +20,8 @@ public class Intellij extends IdeaBasedIdeToolCommandlet { private static final String IDEA64_EXE = IDEA + "64.exe"; + private static final String IDEA_BASH_SCRIPT = IDEA + ".sh"; + /** * The constructor. * @@ -35,7 +38,13 @@ protected String getBinaryName() { if (this.context.getSystemInfo().isWindows()) { return IDEA64_EXE; } else { - return IDEA; + if (Files.exists(this.getToolBinPath().resolve(IDEA))) { + return IDEA; + } else if (Files.exists(this.getToolBinPath().resolve(IDEA_BASH_SCRIPT))) { + return IDEA_BASH_SCRIPT; + } else { + return IDEA; + } } }