From 170cdfce753967120caf9309fa131edecf57f310 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Thu, 18 Feb 2016 21:42:17 +0400 Subject: [PATCH] Don't overwrite the distribution if it's already there. --- .../wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java index e5ef2062..8b9441ef 100644 --- a/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java +++ b/modules/wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java @@ -138,14 +138,16 @@ public class Main { String zipOutputDir = DISTRIBUTIONS_DIR + "/" + wrapperVersion; Path kobaltJarFile = Paths.get(zipOutputDir, getWrapperDir().getPath() + "/" + FILE_NAME + "-" + wrapperVersion + ".jar"); + boolean downloadedZipFile = false; if (! Files.exists(localZipFile) || ! Files.exists(kobaltJarFile)) { download(localZipFile.toFile(), wrapperVersion); + downloadedZipFile = true; } // // Extract all the zip files // - if (! noOverwrite) { + if (! noOverwrite && downloadedZipFile) { int retries = 0; while (retries < 2) { try {