Skip to content

Commit 5f87d4b

Browse files
authored
Resolve Symbolic Links in Groovy Folder in Debug Mode (#210)
* Resolve Symbolic Links when Finding Scripts * Only Enable Following in Debug Mode
1 parent 13c6a1b commit 5f87d4b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/com/cleanroommc/groovyscript/sandbox/RunConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import java.io.File;
2323
import java.io.IOException;
24+
import java.nio.file.FileVisitOption;
2425
import java.nio.file.Files;
2526
import java.nio.file.Path;
2627
import java.util.*;
@@ -319,7 +320,7 @@ private Collection<File> getSortedFilesOf(File root, Collection<String> paths) {
319320
continue;
320321
}
321322
int pathSize = path.split(separator).length;
322-
try (Stream<Path> stream = Files.walk(rootFile.toPath())) {
323+
try (Stream<Path> stream = Files.walk(rootFile.toPath(), isDebug() ? new FileVisitOption[] { FileVisitOption.FOLLOW_LINKS } : new FileVisitOption[0])) {
323324
stream.filter(path1 -> isGroovyFile(path1.toString()))
324325
.map(Path::toFile)
325326
//.filter(Preprocessor::validatePreprocessors)

0 commit comments

Comments
 (0)