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:
parent
0a0b478ba3
commit
7dc1183953
3 changed files with 5 additions and 3 deletions
|
@ -1 +1 @@
|
||||||
kobalt.version=0.924
|
kobalt.version=0.925
|
|
@ -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,
|
private void copyToStreamWithProgress(InputStream inputStream, OutputStream outputStream, long contentLength,
|
||||||
String url) throws IOException {
|
String url) throws IOException {
|
||||||
int bytesRead;
|
int bytesRead;
|
||||||
long bytesSoFar = 0;
|
long bytesSoFar = 0;
|
||||||
byte[] buffer = new byte[100_000];
|
byte[] buffer = new byte[100_000];
|
||||||
boolean hasTerminal = System.console() != null;
|
boolean hasTerminal = System.console() != null && System.getProperty(PROPERTY_NO_ANIMATIONS) == null;
|
||||||
if (! hasTerminal) {
|
if (! hasTerminal) {
|
||||||
log2(1, "\rDownloading " + url);
|
log2(1, "\rDownloading " + url);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
kobalt.version=0.924
|
kobalt.version=0.925
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue