From 15a1e89d8fc65fb28b30366dad59384a4e8a9eee Mon Sep 17 00:00:00 2001 From: Andrey Kaipov Date: Fri, 9 Oct 2020 18:11:45 -0400 Subject: [PATCH] catch grgit errors --- build.gradle.kts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index d8e29154f2..ce2ef4f1cc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -50,8 +50,12 @@ plugins { application } -val grgit = Grgit.open(mapOf("dir" to rootProject.projectDir.absolutePath)) -val localGitCommit = grgit.head().id +val localGitCommit = try { + val projectPath = rootProject.projectDir.absolutePath + Grgit.open(mapOf("dir" to projectPath)).head().id +} catch (_: Exception) { + "n/a" +} fun isNonStable(version: String): Boolean { return listOf("ALPHA", "BETA", "RC").any {