Skip to content

Commit af4bda6

Browse files
committed
Fix Releasing.main.kts: missed the date in version header
1 parent 8d51621 commit af4bda6

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Releasing.main.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import lib_publisher_tools.versioning.checkIsValidVersionString
2222
import lib_publisher_tools.versioning.stabilityLevel
2323
import java.net.URLEncoder
2424
import java.nio.charset.Charset
25+
import java.text.SimpleDateFormat
26+
import java.util.Date
2527

2628
val gitHubRepoUrl = "https://github.com/jmfayard/refreshVersions"
2729

@@ -252,12 +254,13 @@ fun CliUi.runReleaseStep(step: ReleaseStep): Unit = when (step) {
252254
requestManualAction("Update the `${file.name}` for the impending release.")
253255
file.checkChanged()
254256
val version = OngoingRelease.newVersion
255-
val startOfThisVersionHeading = "## Version $version"
257+
val dateString = SimpleDateFormat("yyyy-MM-dd").format(Date())
258+
val startOfThisVersionHeading = "## Version $version ($dateString)"
256259
val expectedHeadingCount = file.useLines { lines -> lines.count { it == startOfThisVersionHeading } }
257260
check(expectedHeadingCount == 1) {
258261
when (expectedHeadingCount) {
259262
0 -> "Didn't find the header for the upcoming release in the ${file.name}.\n" +
260-
"Is there a typo or an extra character?\n" +
263+
"Is there a typo or, an extra character, or is it the wrong date?\n" +
261264
"Expected to find ${AnsiColor.bold}$startOfThisVersionHeading${AnsiColor.RESET}."
262265
else -> "Found multiple occurrences of the header for the upcoming release in the ${file.name}.\n" +
263266
"Keep only one."

0 commit comments

Comments
 (0)