whoops messed up the extension retrieval

This commit is contained in:
Julian Krings 2025-07-25 13:21:16 +02:00
parent 08b9058c8f
commit b0ca0e3617
No known key found for this signature in database
GPG Key ID: 208C6E08C3B718D2

View File

@ -141,10 +141,10 @@ tasks {
"main" to main,
"environment" to if (project.hasProperty("release")) "production" else "development",
"commit" to provider {
runCatching { extensions.getByType<Grgit>().head().id }
.getOrDefault("")
val res = runCatching { project.extensions.getByType<Grgit>().head().id }
res.getOrDefault("")
.takeIf { it.length == 40 } ?: {
project.logger.error("Git commit hash not found")
logger.error("Git commit hash not found", res.exceptionOrNull())
"unknown"
}()
},