Skip to content

Commit

Permalink
fix git commit shortMessage having lines breaks in BuildConfig.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
zoff99 committed Nov 20, 2023
1 parent aa85941 commit b477837
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ buildConfig {
{
buildConfigField("String", "GIT_COMMIT_HASH", "\"" + grgit.head().abbreviatedId + "\"")
buildConfigField("String", "GIT_COMMIT_DATE", "\"" + grgit.head().dateTime.
format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "\"")
buildConfigField("String", "GIT_COMMIT_MSG", "\"" + grgit.head().shortMessage.replace("\"", "_") + "\"")
format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")) + "\"")
buildConfigField("String", "GIT_COMMIT_MSG", "\"" + grgit.head().shortMessage.
replace("\"", "_").replace("\n", "_").
replace("\r", "_").take(40) + "\"")
}
catch (e: Exception)
{
Expand Down

0 comments on commit b477837

Please sign in to comment.