File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import lib_publisher_tools.versioning.checkIsValidVersionString
2222import lib_publisher_tools.versioning.stabilityLevel
2323import java.net.URLEncoder
2424import java.nio.charset.Charset
25+ import java.text.SimpleDateFormat
26+ import java.util.Date
2527
2628val 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."
You can’t perform that action at this time.
0 commit comments