Skip to content

Commit

Permalink
#183: removed isInstalledVersion()
Browse files Browse the repository at this point in the history
this method was only used once and caused the duplicate msg if the tool was already installed.
  • Loading branch information
MattesMrzik committed Jan 16, 2024
1 parent 6954a34 commit adb48f2
Showing 1 changed file with 1 addition and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public LocalToolCommandlet(IdeContext context, String tool, Set<String> tags) {
super(context, tool, tags);
}


/**
* @return the {@link Path} where the tool is located (installed).
*/
Expand Down Expand Up @@ -66,7 +65,7 @@ protected boolean doInstall(boolean silent) {
// check if we already have this version installed (linked) locally in IDE_HOME/software
VersionIdentifier installedVersion = getInstalledVersion();
VersionIdentifier resolvedVersion = installation.resolvedVersion();
if (isInstalledVersion(resolvedVersion, installedVersion, silent)) {
if (resolvedVersion.equals(installedVersion)) {
return false;
}
// we need to link the version or update the link.
Expand Down Expand Up @@ -167,19 +166,4 @@ private ToolInstallation createToolInstallation(Path rootDir, VersionIdentifier
return new ToolInstallation(rootDir, linkDir, binDir, resolvedVersion);
}

private boolean isInstalledVersion(VersionIdentifier expectedVersion, VersionIdentifier installedVersion,
boolean silent) {

if (expectedVersion.equals(installedVersion)) {
IdeLogLevel level = IdeLogLevel.INFO;
if (silent) {
level = IdeLogLevel.DEBUG;
}
this.context.level(level).log("Version {} of tool {} is already installed", installedVersion,
getToolWithEdition());
return true;
}
return false;
}

}

0 comments on commit adb48f2

Please sign in to comment.