Zond: несколько фиксов
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
group = 'asys'
|
group = 'asys'
|
||||||
version = '0.6.12-SNAPSHOT'
|
version = '0.6.13-SNAPSHOT'
|
||||||
|
|
||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class Main {
|
|||||||
PipeInputStream pipeInputStream = new PipeInputStream();
|
PipeInputStream pipeInputStream = new PipeInputStream();
|
||||||
Shell.getInstance().start(System.in, commandLine -> {
|
Shell.getInstance().start(System.in, commandLine -> {
|
||||||
if (commandLine.equalsIgnoreCase(":exit")) {
|
if (commandLine.equalsIgnoreCase(":exit")) {
|
||||||
Shell.getInstance().getOutput().println("force exit");
|
log("force exit");
|
||||||
watchdog.destroyProcess();
|
watchdog.destroyProcess();
|
||||||
Shell.getInstance().shutdown();
|
Shell.getInstance().shutdown();
|
||||||
Main.shutdown();
|
Main.shutdown();
|
||||||
@@ -64,17 +64,11 @@ public class Main {
|
|||||||
}
|
}
|
||||||
pipeInputStream.write(commandLine+"\r\n");
|
pipeInputStream.write(commandLine+"\r\n");
|
||||||
});
|
});
|
||||||
|
|
||||||
Connector.getInstance().startReconnect();
|
Connector.getInstance().startReconnect();
|
||||||
|
executeProcess(args, Shell.getInstance().getOutput(), pipeInputStream);
|
||||||
int resultCode = executeProcess(args, Shell.getInstance().getOutput(), pipeInputStream);
|
|
||||||
|
|
||||||
System.out.println(Ansi.ansi().reset().newline()
|
|
||||||
.fg(Color.GREEN).a("Process Finished. Code: ")
|
|
||||||
.bold().fg(Color.WHITE).a(resultCode).reset());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int executeProcess(String[] args, PrintStream printStream, InputStream stdin) throws IOException {
|
private static void executeProcess(String[] args, PrintStream printStream, InputStream stdin) throws IOException {
|
||||||
String cmdLine = Arrays.stream(args).collect(Collectors.joining(" "));
|
String cmdLine = Arrays.stream(args).collect(Collectors.joining(" "));
|
||||||
CommandLine commandLine = CommandLine.parse(cmdLine);
|
CommandLine commandLine = CommandLine.parse(cmdLine);
|
||||||
DefaultExecutor executor = new DefaultExecutor();
|
DefaultExecutor executor = new DefaultExecutor();
|
||||||
@@ -94,7 +88,8 @@ public class Main {
|
|||||||
resultCode = -1;
|
resultCode = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resultCode;
|
watchdog = null;
|
||||||
|
log("Process finished. Code: " + resultCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void loadConfig() throws IOException {
|
private static void loadConfig() throws IOException {
|
||||||
|
|||||||
Reference in New Issue
Block a user