mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-08-17 16:55:57 +00:00
make git commit retrieval fail safe
This commit is contained in:
parent
556bef6e43
commit
08b9058c8f
@ -1,5 +1,6 @@
|
|||||||
import io.github.slimjar.func.slimjar
|
import io.github.slimjar.func.slimjar
|
||||||
import io.github.slimjar.resolver.data.Mirror
|
import io.github.slimjar.resolver.data.Mirror
|
||||||
|
import org.ajoberstar.grgit.Grgit
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -140,10 +141,13 @@ tasks {
|
|||||||
"main" to main,
|
"main" to main,
|
||||||
"environment" to if (project.hasProperty("release")) "production" else "development",
|
"environment" to if (project.hasProperty("release")) "production" else "development",
|
||||||
"commit" to provider {
|
"commit" to provider {
|
||||||
runCatching { grgit.head().id }
|
runCatching { extensions.getByType<Grgit>().head().id }
|
||||||
.getOrDefault("")
|
.getOrDefault("")
|
||||||
.takeIf { it.length == 40 } ?: "unknown"
|
.takeIf { it.length == 40 } ?: {
|
||||||
}
|
project.logger.error("Git commit hash not found")
|
||||||
|
"unknown"
|
||||||
|
}()
|
||||||
|
},
|
||||||
)
|
)
|
||||||
filesMatching("**/plugin.yml") {
|
filesMatching("**/plugin.yml") {
|
||||||
expand(inputs.properties)
|
expand(inputs.properties)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user