Skip to content

Commit

Permalink
👷 Update BumpVersion to allow for linebreaks
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Jan 13, 2025
1 parent afe5906 commit 08e3734
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
14 changes: 4 additions & 10 deletions app/bump_version.main.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ val currentVersionName = versionNameRegex.find(buildGradleContent)!!.groupValues

println("Current version: $currentVersionName ($currentVersionCode)")
println("Detecting bump type...")
var bumpType = args.getOrNull(0)
if(bumpType == null) {
println("BUMP_TYPE not set, input one of: major, minor, patch")
exitProcess(1)
}
var bumpType = args[0]

check(bumpType in listOf("major", "minor", "patch")) { "BUMP_TYPE must be one of: major, minor, patch" }

Expand Down Expand Up @@ -54,11 +50,9 @@ if (!changelogFile.exists()) {
changelogFile.createNewFile()
}

val changelog = args.getOrNull(1)
if(changelog != null) {
println("Writing changelog...")
changelogFile.writeText(changelog)
}
val changelog = args[1].replace("\\n", "\n")
println("Writing changelog...")
changelogFile.writeText(changelog)

ProcessBuilder("git", "add", buildGradleFile.absolutePath, changelogFile.absolutePath).inheritIO().start().waitFor()
ProcessBuilder("git", "commit", "-m", "🔖 Prepare Release $newVersionName ($newVersionCode)").inheritIO().start().waitFor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package br.com.colman.petals.use.io.output

import android.content.res.Resources
import androidx.compose.ui.graphics.Path
import br.com.colman.petals.R
import br.com.colman.petals.R.string.amount_label
import br.com.colman.petals.R.string.cost_per_gram_label
Expand All @@ -28,6 +29,7 @@ import br.com.colman.petals.use.repository.UseRepository
import com.github.doyaaaaaken.kotlincsv.dsl.csvWriter
import kotlinx.coroutines.flow.first
import java.io.ByteArrayOutputStream
import java.util.regex.Matcher
import kotlin.text.Charsets.UTF_8

data class UseCsvHeaders(
Expand Down

0 comments on commit 08e3734

Please sign in to comment.