1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Don't copy files if identical versions.

This commit is contained in:
Cedric Beust 2015-10-08 03:25:44 -07:00
parent 98862fc57f
commit 6153d983f7

View file

@ -28,7 +28,7 @@ public class Main {
private static final String DISTRIBUTIONS_DIR =
System.getProperty("user.home") + "/.kobalt/wrapper/dist";
private final Properties properties = new Properties();
private final Properties wrapperProperties = new Properties();
private static int logLevel = 1;
@ -70,11 +70,11 @@ public class Main {
if (! config.exists()) {
saveFile(config, PROPERTY_VERSION + "=" + version);
}
properties.load(new FileReader(config));
wrapperProperties.load(new FileReader(config));
}
private String getWrapperVersion() {
return properties.getProperty(PROPERTY_VERSION);
return wrapperProperties.getProperty(PROPERTY_VERSION);
}
private boolean isWindows() {
@ -129,6 +129,7 @@ public class Main {
//
// Copy the wrapper files in the current kobalt/wrapper directory
//
if (! version.equals(getWrapperVersion())) {
log(2, "Copying the wrapper files");
for (String file : FILES) {
Path from = Paths.get(zipOutputDir, file);
@ -144,6 +145,9 @@ public class Main {
}
}
new File(KOBALTW).setExecutable(true);
} else {
log(2, "Wrapper and current versions are identical");
}
return kobaltJarFile;
}