From 8938b21e18888d11f3635832c4333ca1c1e816b0 Mon Sep 17 00:00:00 2001 From: Yahav Itzhak Date: Wed, 27 Sep 2023 16:37:17 +0300 Subject: [PATCH] Parse Gradle versions even if strerr is not empty (#198) --- build/gradle.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/gradle.go b/build/gradle.go index 37423d77..71d4df7c 100644 --- a/build/gradle.go +++ b/build/gradle.go @@ -149,12 +149,12 @@ func (gm *GradleModule) getExtractorVersionAndInitScript(gradleExecPath string) if err := gradleRunConfig.runCmd(outBuffer, errBuffer); err != nil { return "", "", err } - if errBuffer.Len() > 0 { - return "", "", errors.New("unexpected error occurred during attempt to get the Gradle version: " + errBuffer.String()) - } gradleVersion, err := parseGradleVersion(outBuffer.String()) if err != nil { + if errBuffer.Len() > 0 { + err = errors.Join(err, errors.New(errBuffer.String())) + } return "", "", err } gm.containingBuild.logger.Info("Using Gradle version:", gradleVersion.GetVersion())