From 92396ab5a651398f9e641c31a0a62d885fe5e773 Mon Sep 17 00:00:00 2001 From: Tony Mountifield Date: Mon, 30 Dec 2024 22:28:09 +0000 Subject: [PATCH] Preserve trailing newline in $changelog for correct sorting --- tools/changelog-helper.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/changelog-helper.sh b/tools/changelog-helper.sh index 171532082b..92bb2c32fa 100755 --- a/tools/changelog-helper.sh +++ b/tools/changelog-helper.sh @@ -141,7 +141,8 @@ group_entries() { local index=0 for category in "${category_order[@]}"; do # use | as delimiter, as category may contain / - changelog=$(sed -re 's|^(- '"${category}"')|'"${index}"' \1|' <<< "${changelog}") + # also re-add stripped newline from last line, for correct sorting + changelog=$(sed -re 's|^(- '"${category}"')|'"${index}"' \1|' <<< "${changelog}")$'\n' index=$((index + 1)) done