From b77cf2524debc77fc521bb6db0bb93d36560c6c9 Mon Sep 17 00:00:00 2001 From: SnowCutieOwO <89032291+SnowCutieOwO@users.noreply.github.com> Date: Wed, 13 Mar 2024 17:59:48 +0800 Subject: [PATCH] build: fix grgit failsafe being unreachable (#258) * Update build.gradle * Update build.gradle * Update build.gradle --- build.gradle | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 4e118167..08764131 100644 --- a/build.gradle +++ b/build.gradle @@ -166,15 +166,11 @@ logger.lifecycle("Building HuskSync ${version} by William278") @SuppressWarnings('GrMethodMayBeStatic') def versionMetadata() { - // Get if there is a tag for this commit - def tag = grgit.tag.list().find { it.commit.id == grgit.head().id } - if (tag != null) { - return '' - } - - // Otherwise, get the last commit hash and if it's a clean head + // Get the last commit hash and if it's a clean head if (grgit == null) { return '-' + System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown' } + // If grgit DOES exist, get tag for this commit + def tag = grgit.tag.list().find { it.commit.id == grgit.head().id } return '-' + grgit.head().abbreviatedId + (grgit.status().clean ? '' : '-indev') -} \ No newline at end of file +}