Skip to content

Commit

Permalink
Don't flag on protoc if the default fallback source directory is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ascopes committed May 12, 2024
1 parent 6187513 commit f4f8700
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,13 @@ private Collection<Path> sourceDirectories() {
.stream()
.flatMap(Collection::stream)
.map(File::toPath)
.collect(Collectors.toList());

var finalDirectories = transformedSourceDirectories.isEmpty()
? List.of(defaultSourceDirectory())
: transformedSourceDirectories;

return finalDirectories.stream()
.filter(path -> {
if (Files.notExists(path)) {
log.warn("Ignoring source directory {} as it does not appear to exist", path);
Expand All @@ -682,10 +689,6 @@ private Collection<Path> sourceDirectories() {
return true;
})
.collect(Collectors.toList());

return transformedSourceDirectories.isEmpty()
? List.of(defaultSourceDirectory())
: transformedSourceDirectories;
}

private String protocVersion() {
Expand Down

0 comments on commit f4f8700

Please sign in to comment.