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);