From 4dc7919ec0ccf78df525dc5cee7a90482d900856 Mon Sep 17 00:00:00 2001 From: mcclure Date: Tue, 14 Feb 2023 14:15:42 -0500 Subject: [PATCH] Fix sporadic failure in non-git build (using patch by @nikclayton) (#3307) --- app/build.gradle | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index b8098a9f..283a8374 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,12 +7,13 @@ plugins { // For constructing gitSha only def getGitSha = { - try { + try { // Try-catch is necessary for build to work on non-git distributions providers.exec { commandLine 'git', 'rev-parse', 'HEAD' + executionResult.rethrowFailure() // Without this, sometimes it just stops immediately instead of throwing }.standardOutput.asText.get().trim() } catch (Exception e) { - "unknown" // Try-catch is necessary for build to work on non-git distributions + "unknown" } }