Skip to content

Commit 795203b

Browse files
committed
CI failed due to no modules directory
1 parent afca89d commit 795203b

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/test/java/name/ipsi/project/fwbp/MainTest.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,16 @@ class MainTest {
2020
void testAdventure() throws Exception {
2121
Main.configureLogging();
2222
var outputPath = Path.of("modules");
23-
Files.walkFileTree(outputPath, new SimpleFileVisitor<>() {
24-
@Override
25-
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
26-
Files.delete(file);
27-
return FileVisitResult.CONTINUE;
28-
}
29-
});
23+
// If it exists but isn't a directory... bugger.
24+
if (Files.isDirectory(outputPath)) {
25+
Files.walkFileTree(outputPath, new SimpleFileVisitor<>() {
26+
@Override
27+
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
28+
Files.delete(file);
29+
return FileVisitResult.CONTINUE;
30+
}
31+
});
32+
}
3033

3134
var filePath = System.getenv("PDF_FILE_PATH");
3235
if (filePath == null) {

0 commit comments

Comments
 (0)