Skip to content

Commit 8664f0b

Browse files
author
liuyong
committed
优化test 自动删除测试数据文件
1 parent 4b5afc8 commit 8664f0b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/main/java/com/vue/adminlte4j/support/FileChangeListener.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,11 @@ public FileChangeListener autoConfig(String type) {
9292
isInterrupted = true ;
9393
e.printStackTrace();
9494
}
95-
96-
fileEntries.forEach(f -> {
95+
if(copies.size() != fileEntries.size()) {
96+
copies.clear();
97+
copies.addAll(fileEntries) ;
98+
}
99+
copies.forEach(f -> {
97100
try {
98101
onChange(f);
99102
} catch (Exception e) {
@@ -108,11 +111,6 @@ private void addFileEntries(FileEntry fileEntry) throws IOException {
108111
if(!fileEntry.srcPath.toFile().exists())
109112
return;
110113
Files.walk(fileEntry.srcPath, FileVisitOption.FOLLOW_LINKS).forEach(path -> {
111-
/*if(path.toFile().isFile() && path.toString().endsWith(".html")) {
112-
Path relativePath = fileEntry.srcPath.relativize(path) ;
113-
listenAbsolute(path).toAbsolute(Paths.get(fileEntry.targetPath.toString() , relativePath.toString())) ;
114-
}*/
115-
116114
Path relativePath = fileEntry.srcPath.relativize(path) ;
117115
Path target = Paths.get(fileEntry.targetPath.toString() , relativePath.toString()) ;
118116
listenAbsolute(path)

0 commit comments

Comments
 (0)