fix(git) Git was failing to find the executable. Since git is a "nice to have", the check will now happen in isApplicable to avoid errors for the user. (Fixes
@@ -59,20 +59,23 @@ public class GitCliDetectable extends Detectable {
return new FileNotFoundDetectableResult(GIT_DIRECTORY_NAME);
}
- return new PassedDetectableResult();
- }
-
- @Override
- public DetectableResult extractable() throws DetectableException {
+ try {
gitExecutable = gitResolver.resolveGit();
-
if (gitExecutable == null) {
+ throw new DetectableException();
+ }
+ } catch (final DetectableException exception) {
return new ExecutableNotFoundDetectableResult("git");
}
return new PassedDetectableResult();
}
+ @Override
+ public DetectableResult extractable() {
+ return new PassedDetectableResult();
+ }
+
@Override
public Extraction extract(final ExtractionEnvironment extractionEnvironment) {
return gitCliExtractor.extract(gitExecutable, environment.getDirectory());
