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

Disable animations with a system property.

This commit is contained in:
Cedric Beust 2017-02-10 09:16:01 -08:00
parent 0a0b478ba3
commit 7dc1183953
3 changed files with 5 additions and 3 deletions

View file

@ -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);
}