!229 关于 一键改包 目录问题

Merge pull request !229 from @C/master
This commit is contained in:
芋道源码 2022-08-19 12:08:02 +00:00 committed by Gitee
commit 83dc4047a9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -50,7 +50,12 @@ public class ProjectReactor {
String projectBaseDirNew = projectBaseDir + "-new"; // 一键改名后项目所在的目录 String projectBaseDirNew = projectBaseDir + "-new"; // 一键改名后项目所在的目录
log.info("[main][检测新项目目录 ({})是否存在]", projectBaseDirNew); log.info("[main][检测新项目目录 ({})是否存在]", projectBaseDirNew);
if (FileUtil.exist(projectBaseDirNew)) { if (FileUtil.exist(projectBaseDirNew)) {
log.info("[main][新项目目录检测 ({})已存在,请更改新的目录,程序退出]", projectBaseDirNew); log.error("[main][新项目目录检测 ({})已存在,请更改新的目录!程序退出]", projectBaseDirNew);
return;
}
// 如果新目录中存在 PACKAGE_NAMEARTIFACT_ID 等关键字路径会被替换导致生成的文件不在预期目录
if (StrUtil.containsAny(projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID, StrUtil.upperFirst(ARTIFACT_ID))) {
log.error("[main][新项目目录检测 ({}) 存在冲突名称「{}」或者「{}」,请更改新的目录!程序退出]", projectBaseDirNew, PACKAGE_NAME, ARTIFACT_ID);
return; return;
} }
log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew); log.info("[main][完成新项目目录检测,新项目路径地址 ({})]", projectBaseDirNew);