File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
src/test/java/name/ipsi/project/fwbp Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -20,13 +20,16 @@ class MainTest {
20
20
void testAdventure () throws Exception {
21
21
Main .configureLogging ();
22
22
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
+ }
30
33
31
34
var filePath = System .getenv ("PDF_FILE_PATH" );
32
35
if (filePath == null ) {
You can’t perform that action at this time.
0 commit comments