Code style for bazelPath.groovy: move the affectation of bazel to the else branch
This address a comment on http://cr.bazel.build/11293 that was misunderstood by
your servitor.
Change-Id: Ic5e1cf73c474005345e513f1ce606c2b3ded19b2
diff --git a/jenkins/lib/vars/bazelPath.groovy b/jenkins/lib/vars/bazelPath.groovy
index 16bdcf0..d41a8c1 100644
--- a/jenkins/lib/vars/bazelPath.groovy
+++ b/jenkins/lib/vars/bazelPath.groovy
@@ -21,10 +21,6 @@
* known location.
*/
def call(String bazel_version, String node_label) {
- def bazel = node_label.startsWith("windows") ?
- "c:\\bazel_ci\\installs\\${bazel_version}\\bazel.exe" :
- "${env.HOME}/.bazel/${bazel_version}/bin/bazel"
-
// Grab bazel
if (bazel_version.startsWith("custom")) {
// A custom version can be completed with a variation, e.g. custom-jdk7, extract it
@@ -50,10 +46,12 @@
selector: [$class: 'SpecificBuildSelector',
buildNumber: "${cause.upstreamBuild}"],
target: targetPath])
- bazel = targetPath + "/" + cause.artifactName
+ return targetPath + "/" + cause.artifactName
} else {
+ def bazel = node_label.startsWith("windows") ?
+ "c:\\bazel_ci\\installs\\${bazel_version}\\bazel.exe" :
+ "${env.HOME}/.bazel/${bazel_version}/bin/bazel"
echo "Using released version of Bazel at ${bazel}"
+ return bazel
}
-
- return bazel
}