Return 1 when Client failed

This commit is contained in:
Friendseeker 2024-10-31 15:05:48 -07:00
parent 94f239f4ae
commit 0368243ed9
1 changed files with 3 additions and 1 deletions

View File

@ -9,19 +9,21 @@
package sbt.client;
import sbt.internal.client.NetworkClient;
import java.nio.file.Paths;
import org.fusesource.jansi.AnsiConsole;
public class Client {
public static void main(final String[] args) {
boolean isWin = System.getProperty("os.name").toLowerCase().startsWith("win");
boolean hadError = false;
try {
if (isWin) AnsiConsole.systemInstall();
NetworkClient.main(args);
} catch (final Throwable t) {
t.printStackTrace();
hadError = true;
} finally {
if (isWin) AnsiConsole.systemUninstall();
if (hadError) System.exit(1);
}
}
}