mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01:00
Fix build script not working when git repo isn't cloned (#3831)
This commit is contained in:
parent
d4ed77fdc6
commit
f320705216
@ -20,6 +20,9 @@ allprojects {
|
||||
}
|
||||
|
||||
def commitsSinceLastTag() {
|
||||
if (grgit == null) {
|
||||
return 0
|
||||
}
|
||||
def tags = grgit.tag.list().stream().map({it.commit}).toList()
|
||||
def commit = grgit.head()
|
||||
def depth = 0
|
||||
@ -32,7 +35,7 @@ def commitsSinceLastTag() {
|
||||
}
|
||||
|
||||
ext {
|
||||
GIT_COMMIT = grgit.head().abbreviatedId
|
||||
GIT_COMMIT = grgit == null ? "unknown" : grgit.head().abbreviatedId
|
||||
GIT_DEPTH = commitsSinceLastTag()
|
||||
|
||||
fullVersion = "${version}-${GIT_COMMIT}".replace("-SNAPSHOT", "-dev+${GIT_DEPTH}")
|
||||
|
Loading…
Reference in New Issue
Block a user