Skip to content

Commit

Permalink
Updated SchemaFinder to take into consideration symbolic links (#1199)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mercieca authored May 11, 2023
1 parent 10381ce commit bf87013
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kobylynskyi.graphql.codegen.supplier;

import java.io.IOException;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
Expand Down Expand Up @@ -78,7 +79,11 @@ public void setExcludedFiles(Set<String> excludedFiles) {
*/
public List<String> findSchemas() throws IOException {
int maxDepth = recursive ? Integer.MAX_VALUE : 1;
try (Stream<Path> paths = Files.find(rootDir, maxDepth, (path, attrs) -> shouldInclude(path))) {

try (
Stream<Path> paths =
Files.find(rootDir, maxDepth, (path, attrs) -> shouldInclude(path), FileVisitOption.FOLLOW_LINKS)
) {
return paths.map(Path::toString).sorted().collect(Collectors.toList());
}
}
Expand Down

0 comments on commit bf87013

Please sign in to comment.