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

Don't generate kobaltw if it's already there.

This commit is contained in:
Cedric Beust 2015-12-12 23:19:26 -08:00
parent c6009a6a1e
commit fe1c8a3545
2 changed files with 6 additions and 8 deletions

View file

@ -166,23 +166,21 @@ public class Main {
for (String file : FILES) {
Path to = Paths.get(new File(".").getAbsolutePath(), file);
if (file.equals(KOBALTW)) {
generateKobaltW(to);
}
if (Files.exists(to)) {
log(2, to + " already exists, not overwriting it");
log(2, " $to already exists, not overwriting it");
continue;
} else {
} else if (file.equals(KOBALTW)) {
generateKobaltW(to);
} else {
Path from = Paths.get(zipOutputDir, file);
try {
if (isWindows() && to.toFile().exists()) {
log(2, "Windows detected, not overwriting " + to);
log(2, " Windows detected, not overwriting " + to);
} else {
Files.copy(from, to, StandardCopyOption.REPLACE_EXISTING);
}
} catch (IOException ex) {
log(1, "Couldn't copy " + from + " to " + to + ": " + ex.getMessage());
log(1, " Couldn't copy " + from + " to " + to + ": " + ex.getMessage());
}
}
}