脚本执行返回
This commit is contained in:
@@ -65,16 +65,16 @@ public class AsyncCommandExecutor {
|
||||
// 异步读取输出
|
||||
Process finalProcess = process;
|
||||
Future<String> outputFuture = executorService.submit(() -> {
|
||||
// StringBuilder output = new StringBuilder();
|
||||
String output = "";
|
||||
StringBuilder output = new StringBuilder();
|
||||
// String output = "";
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(finalProcess.getInputStream()))) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
// output.append(line).append("\n");
|
||||
output = line;
|
||||
output.append(line).append("\n");
|
||||
// output = line;
|
||||
}
|
||||
}
|
||||
return output;
|
||||
return output.toString();
|
||||
});
|
||||
|
||||
// 设置超时
|
||||
|
||||
Reference in New Issue
Block a user