From 7dc11839539203ee1afba3a26232783d07bd05c4 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 10 Feb 2017 09:16:01 -0800 Subject: [PATCH] Disable animations with a system property. --- kobalt/wrapper/kobalt-wrapper.properties | 2 +- .../wrapper/src/main/java/com/beust/kobalt/wrapper/Main.java | 4 +++- src/main/resources/kobalt.properties | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index f1a13f29..475a8233 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.924 \ No newline at end of file +kobalt.version=0.925 \ No newline at end of file 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 aad7d9f8..f5642cd7 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 @@ -431,12 +431,14 @@ public class Main { } } + private static String PROPERTY_NO_ANIMATIONS = "com.beust.kobalt.noAnimations"; + private void copyToStreamWithProgress(InputStream inputStream, OutputStream outputStream, long contentLength, String url) throws IOException { int bytesRead; long bytesSoFar = 0; byte[] buffer = new byte[100_000]; - boolean hasTerminal = System.console() != null; + boolean hasTerminal = System.console() != null && System.getProperty(PROPERTY_NO_ANIMATIONS) == null; if (! hasTerminal) { log2(1, "\rDownloading " + url); } diff --git a/src/main/resources/kobalt.properties b/src/main/resources/kobalt.properties index 13b8e14f..1ae87372 100644 --- a/src/main/resources/kobalt.properties +++ b/src/main/resources/kobalt.properties @@ -1 +1 @@ -kobalt.version=0.924 +kobalt.version=0.925