Skip to content

Commit

Permalink
🧱 Fix CLI downloader when a binary exists
Browse files Browse the repository at this point in the history
  • Loading branch information
tiulpin committed Jul 3, 2024
1 parent 18aa0d7 commit 6b043d2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions common/src/main/kotlin/org/jetbrains/qodana/cli/Qodana.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ class Installer {

fun setup(path: File, downloadURL: String = getQodanaUrl(), version: String = getLatestVersion()): String {
if (path.exists()) {
verifyChecksum(path, getChecksum(version))
return path.absolutePath
} else try {
try {
verifyChecksum(path, getChecksum(version))
return path.absolutePath
} catch (e: IOException) {
log.warning("Checksum verification failed. Redownloading the binary.")
}
path.delete()
}

try {
download(downloadURL, path)
verifyChecksum(path, getChecksum(version))
} catch (e: IOException) {
Expand Down

0 comments on commit 6b043d2

Please sign in to comment.