From 458e9673367ceba7722d7ef4c929dd15da81b397 Mon Sep 17 00:00:00 2001 From: bwcx_jzy Date: Wed, 27 May 2020 19:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + modules/common/src/main/java/io/jpom/util/CommandUtil.java | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70227eedb..bf5013e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ 3. 【Server】节点分发列表点击控制台、文件管理404 4. 【Server】节点分发顺序重启休眠时间取构建名称最后的时间(测试构建:10 则睡眠时间为10秒) 5. 【Agent】启动完成打印授权信息日志级别调至error +6. CommandUtil.asyncExeLocalCommand 方法格式化命令中的换行 ----------------------------------------------------------- diff --git a/modules/common/src/main/java/io/jpom/util/CommandUtil.java b/modules/common/src/main/java/io/jpom/util/CommandUtil.java index 007acda7c..04cc69ce9 100644 --- a/modules/common/src/main/java/io/jpom/util/CommandUtil.java +++ b/modules/common/src/main/java/io/jpom/util/CommandUtil.java @@ -113,9 +113,12 @@ public class CommandUtil { * @throws IOException 异常 */ public static void asyncExeLocalCommand(File file, String command) throws Exception { - DefaultSystemLog.getLog().info(command); + String newCommand = StrUtil.replace(command, StrUtil.CRLF, StrUtil.SPACE); + newCommand = StrUtil.replace(newCommand, StrUtil.LF, StrUtil.SPACE); + // + DefaultSystemLog.getLog().info(newCommand); List commands = getCommand(); - commands.add(command); + commands.add(newCommand); ProcessBuilder pb = new ProcessBuilder(commands); if (file != null) { pb.directory(file);