修复 ProjectReactor 一键改包的报错
This commit is contained in:
parent
f672af1a09
commit
2247f21db8
@ -66,7 +66,7 @@ public class ProjectReactor {
|
|||||||
// 写入文件
|
// 写入文件
|
||||||
files.forEach(file -> {
|
files.forEach(file -> {
|
||||||
// 如果是白名单的文件类型,不进行重写,直接拷贝
|
// 如果是白名单的文件类型,不进行重写,直接拷贝
|
||||||
String fileType = FileTypeUtil.getType(file);
|
String fileType = getFileType(file);
|
||||||
if (WHITE_FILE_TYPES.contains(fileType)) {
|
if (WHITE_FILE_TYPES.contains(fileType)) {
|
||||||
copyFile(file, projectBaseDir, projectBaseDirNew, packageNameNew, artifactIdNew);
|
copyFile(file, projectBaseDir, projectBaseDirNew, packageNameNew, artifactIdNew);
|
||||||
return;
|
return;
|
||||||
@ -106,7 +106,7 @@ public class ProjectReactor {
|
|||||||
String titleNew) {
|
String titleNew) {
|
||||||
String content = FileUtil.readString(file, StandardCharsets.UTF_8);
|
String content = FileUtil.readString(file, StandardCharsets.UTF_8);
|
||||||
// 如果是白名单的文件类型,不进行重写
|
// 如果是白名单的文件类型,不进行重写
|
||||||
String fileType = FileTypeUtil.getType(file);
|
String fileType = getFileType(file);
|
||||||
if (WHITE_FILE_TYPES.contains(fileType)) {
|
if (WHITE_FILE_TYPES.contains(fileType)) {
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
@ -139,4 +139,7 @@ public class ProjectReactor {
|
|||||||
.replaceAll(StrUtil.upperFirst(ARTIFACT_ID), StrUtil.upperFirst(artifactIdNew));
|
.replaceAll(StrUtil.upperFirst(ARTIFACT_ID), StrUtil.upperFirst(artifactIdNew));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getFileType(File file) {
|
||||||
|
return file.length() > 0 ? FileTypeUtil.getType(file) : "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user