mirror of https://github.com/sbt/sbt.git
Merge pull request #5945 from eatkins/boot-system-in-fix
Fix sbt hangs with invalid build.sbt and --batch
This commit is contained in:
commit
715bccacd9
|
|
@ -179,6 +179,7 @@ trait Terminal extends AutoCloseable {
|
|||
}
|
||||
|
||||
object Terminal {
|
||||
val NO_BOOT_CLIENTS_CONNECTED: Int = -2
|
||||
// Disable noisy jline log spam
|
||||
if (System.getProperty("sbt.jline.verbose", "false") != "true")
|
||||
jline.internal.Log.setOutput(new PrintStream(_ => {}, false))
|
||||
|
|
@ -619,6 +620,11 @@ object Terminal {
|
|||
if (running.get) {
|
||||
inputStream.read match {
|
||||
case -1 =>
|
||||
case `NO_BOOT_CLIENTS_CONNECTED` =>
|
||||
if (System.console == null) {
|
||||
result.put(-1)
|
||||
running.set(false)
|
||||
}
|
||||
case i =>
|
||||
result.put(i)
|
||||
running.set(false)
|
||||
|
|
|
|||
|
|
@ -216,6 +216,7 @@ public class BootServerSocket implements AutoCloseable {
|
|||
new InputStream() {
|
||||
@Override
|
||||
public int read() {
|
||||
if (clientSockets.isEmpty()) return Terminal.NO_BOOT_CLIENTS_CONNECTED();
|
||||
try {
|
||||
synchronized (needInput) {
|
||||
needInput.set(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue