From b8e5eeb271cc9b783916083a085c0d1cd7efdb18 Mon Sep 17 00:00:00 2001 From: "@C" Date: Wed, 27 Jul 2022 07:24:36 +0000 Subject: [PATCH 1/2] =?UTF-8?q?update=20yudao-server/src/test/java/cn/ioco?= =?UTF-8?q?der/yudao/ProjectReactor.java.=20=E8=A7=A3=E5=86=B3=20=E4=B8=80?= =?UTF-8?q?=E9=94=AE=E6=94=B9=E5=8C=85=20=E5=8F=AF=E8=83=BD=E5=8F=91?= =?UTF-8?q?=E7=94=9F=E7=9A=84=E7=9B=AE=E5=BD=95=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/cn/iocoder/yudao/ProjectReactor.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index e3b8c11c8..2d0861f1b 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -53,6 +53,11 @@ public class ProjectReactor { log.info("[main][新项目目录检测 ({})已存在,请更改新的目录,程序退出]", projectBaseDirNew); return; } + //如果新目录中存在 PACKAGE_NAME, ARTIFACT_ID 等关键字,路径会被替换,导致生成的文件不在预期目录 + if(StrUtil.containsAny(projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID, StrUtil.upperFirst(ARTIFACT_ID))) { + log.info("[main][新项目目录检测 ({}) 存在冲突名称「{}」或者「{}」,请更改新的目录,程序退出]", projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID); + return; + } log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew); // 获得需要复制的文件 log.info("[main][开始获得需要重写的文件,预计需要 10-20 秒]"); From c8fcb6d3ed35266a25af45819c6377aa0ce6698e Mon Sep 17 00:00:00 2001 From: cksspk Date: Mon, 1 Aug 2022 09:36:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[fix]=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/cn/iocoder/yudao/ProjectReactor.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java index 2d0861f1b..5a8da1b20 100644 --- a/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java +++ b/yudao-server/src/test/java/cn/iocoder/yudao/ProjectReactor.java @@ -50,12 +50,12 @@ public class ProjectReactor { String projectBaseDirNew = projectBaseDir + "-new"; // 一键改名后,“新”项目所在的目录 log.info("[main][检测新项目目录 ({})是否存在]", projectBaseDirNew); if (FileUtil.exist(projectBaseDirNew)) { - log.info("[main][新项目目录检测 ({})已存在,请更改新的目录,程序退出]", projectBaseDirNew); + log.error("[main][新项目目录检测 ({})已存在,请更改新的目录!程序退出]", projectBaseDirNew); return; } - //如果新目录中存在 PACKAGE_NAME, ARTIFACT_ID 等关键字,路径会被替换,导致生成的文件不在预期目录 - if(StrUtil.containsAny(projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID, StrUtil.upperFirst(ARTIFACT_ID))) { - log.info("[main][新项目目录检测 ({}) 存在冲突名称「{}」或者「{}」,请更改新的目录,程序退出]", projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID); + // 如果新目录中存在 PACKAGE_NAME,ARTIFACT_ID 等关键字,路径会被替换,导致生成的文件不在预期目录 + if (StrUtil.containsAny(projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID, StrUtil.upperFirst(ARTIFACT_ID))) { + log.error("[main][新项目目录检测 ({}) 存在冲突名称「{}」或者「{}」,请更改新的目录!程序退出]", projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID); return; } log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew);