Skip to content

Commit

Permalink
#851: implemented requested changes
Browse files Browse the repository at this point in the history
added checks for idea and studio files as well als idea.sh and studio.sh
  • Loading branch information
jan-vcapgemini committed Dec 9, 2024
1 parent cd0feb8 commit 69b781a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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.
*
Expand All @@ -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;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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.
*
Expand All @@ -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;
}
}
}

Expand Down

0 comments on commit 69b781a

Please sign in to comment.