Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#183: removed isInstalledVersion() #184

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}

}