Skip to content

Commit

Permalink
Resolve Symbolic Links in Groovy Folder in Debug Mode (#210)
Browse files Browse the repository at this point in the history
* Resolve Symbolic Links when Finding Scripts

* Only Enable Following in Debug Mode
  • Loading branch information
IntegerLimit committed Aug 16, 2024
1 parent 13c6a1b commit 5f87d4b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
Expand Down Expand Up @@ -319,7 +320,7 @@ private Collection<File> getSortedFilesOf(File root, Collection<String> paths) {
continue;
}
int pathSize = path.split(separator).length;
try (Stream<Path> stream = Files.walk(rootFile.toPath())) {
try (Stream<Path> stream = Files.walk(rootFile.toPath(), isDebug() ? new FileVisitOption[] { FileVisitOption.FOLLOW_LINKS } : new FileVisitOption[0])) {
stream.filter(path1 -> isGroovyFile(path1.toString()))
.map(Path::toFile)
//.filter(Preprocessor::validatePreprocessors)
Expand Down

0 comments on commit 5f87d4b

Please sign in to comment.