Skip to content

Commit

Permalink
Auto merge of #12581 - lnicola:changelog-number, r=lnicola
Browse files Browse the repository at this point in the history
internal: Handle fractional release numbers in changelog naming
  • Loading branch information
bors committed Jun 19, 2022
2 parents eb9b360 + e48ed53 commit 427061d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion xtask/src/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ impl flags::Release {

let today = date_iso(sh)?;
let commit = cmd!(sh, "git rev-parse HEAD").read()?;
let changelog_n = sh.read_dir(changelog_dir.as_path())?.len();
let changelog_n = sh
.read_dir(changelog_dir.as_path())?
.into_iter()
.filter_map(|p| p.file_stem().map(|s| s.to_string_lossy().to_string()))
.filter_map(|s| s.splitn(5, '-').last().map(|n| n.replace('-', ".")))
.filter_map(|s| s.parse::<f32>().ok())
.map(|n| 1 + n.floor() as usize)
.max()
.unwrap_or_default();

for adoc in [
"manual.adoc",
Expand Down

0 comments on commit 427061d

Please sign in to comment.