Skip to content

Commit

Permalink
build: don't fail if ks env var is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Tommy-Geenexus committed Aug 4, 2024
1 parent f6511a9 commit fa28b59
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,18 @@ fun loadKeyStoreProperties(): Triple<String, String, String> {
)
}

fun getOrCreateKeyStoreFile(): File {
fun getOrCreateKeyStoreFile(): File? {
val keyStore = projectDir.parentFile.listFiles()?.find { file -> file.extension == "jks" }
return if (keyStore?.exists() == true) {
keyStore
} else {
File(projectDir.parentFile, keyStoreFile).apply {
writeBytes(Base64.decode(System.getenv(keyStoreBase64).toByteArray()))
val ks = System.getenv(keyStoreBase64)
if (ks == null) {
null
} else {
File(projectDir.parentFile, keyStoreFile).apply {
writeBytes(Base64.decode(ks.toByteArray()))
}
}
}
}
Expand Down

0 comments on commit fa28b59

Please sign in to comment.