Skip to content

Commit

Permalink
fix(bazel): check for workspace file in extractable method so you get…
Browse files Browse the repository at this point in the history
… an error if it's not found
  • Loading branch information
Steve Billings committed Oct 7, 2019
1 parent 760fdba commit 9a85c15
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -62,16 +62,16 @@ public DetectableResult applicable() {
if (StringUtils.isBlank(bazelDetectableOptions.getTargetName())) {
return new PropertyInsufficientDetectableResult();
}
final File workspaceFile = fileFinder.findFile(environment.getDirectory(), WORKSPACE_FILENAME);
if (workspaceFile == null) {
return new FilesNotFoundDetectableResult(WORKSPACE_FILENAME);
}
bazelWorkspace = new BazelWorkspace(workspaceFile);
return new PassedDetectableResult();
}

@Override
public DetectableResult extractable() throws DetectableException {
final File workspaceFile = fileFinder.findFile(environment.getDirectory(), WORKSPACE_FILENAME);
if (workspaceFile == null) {
return new FilesNotFoundDetectableResult(WORKSPACE_FILENAME);
}
bazelWorkspace = new BazelWorkspace(workspaceFile);
bazelExe = bazelResolver.resolveBazel();
if (bazelExe == null) {
return new ExecutableNotFoundDetectableResult("bazel");
Expand Down

0 comments on commit 9a85c15

Please sign in to comment.