Skip to content

Commit

Permalink
Update PathProtocResolver.java to ignore executable bit on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ascopes authored Oct 23, 2023
1 parent 49aafe6 commit 36e41eb
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public Path resolveProtoc() throws ProtocResolutionException {

try (var fileStream = Files.list(indexableDirectory)) {
var result = fileStream
.filter(Files::isExecutable)
.filter(this::isExecutable)
.filter(this::isProtoc)
.findFirst();

Expand All @@ -83,6 +83,11 @@ public Path resolveProtoc() throws ProtocResolutionException {
}
}

private boolean isExecutable(Path path) {
// TODO(ascopes): Verify this is the correct logic...
return HostEnvironment.isWindows() || Files.isExecutable(path);
}

private boolean isProtoc(Path path) {
var fileName = path.getFileName().toString();

Expand Down

0 comments on commit 36e41eb

Please sign in to comment.