Skip to content

Commit

Permalink
build: get tag if branch getter fails
Browse files Browse the repository at this point in the history
  • Loading branch information
aliernfrog committed Sep 4, 2024
1 parent 98e0e23 commit 111c677
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ android.defaultConfig.buildConfigField("String[]", "LANGUAGES", "new String[]{${
// Utilities to get git environment information
// Source: https://github.com/vendetta-mod/VendettaManager/blob/main/app/build.gradle.kts
fun getCurrentBranch() = exec("git", "symbolic-ref", "--short", "HEAD")
?: exec("git", "describe", "--tags", "--exact-match")
fun getLatestCommit() = exec("git", "rev-parse", "--short", "HEAD")
fun hasLocalChanges(): Boolean {
val branch = getCurrentBranch()
Expand All @@ -112,8 +113,7 @@ fun exec(vararg command: String) = try {

if (errout.size() > 0) throw Error(errout.toString(Charsets.UTF_8))
stdout.toString(Charsets.UTF_8).trim()
} catch (e: Throwable) {
e.printStackTrace()
} catch (_: Throwable) {
null
}

Expand All @@ -139,7 +139,7 @@ dependencies {
implementation("io.coil-kt:coil-compose:2.7.0")
implementation("com.github.jeziellago:compose-markdown:0.5.4")
implementation("net.engawapg.lib:zoomable:1.6.2")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.1")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.2")

debugImplementation("androidx.compose.ui:ui-tooling:$composeMaterialVersion")
debugImplementation("androidx.compose.ui:ui-tooling-preview:$composeMaterialVersion")
Expand Down

0 comments on commit 111c677

Please sign in to comment.