diff --git a/app/build.gradle b/app/build.gradle index f05496dc7..215cada2b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -5,9 +5,18 @@ plugins { alias(libs.plugins.kotlin.parcelize) } -final def gitSha = providers.exec { - commandLine('git', 'rev-parse', '--short=7', 'HEAD') -}.standardOutput.asText.get().trim() +// For constructing gitSha only +def getGitSha = { + try { + providers.exec { + commandLine 'git', 'rev-parse', 'HEAD' + }.standardOutput.asText.get().trim() + } catch (Exception e) { + "unknown" // Try-catch is necessary for build to work on non-git distributions + } +} + +final def gitSha = getGitSha() // The app name final def APP_NAME = "Tusky"