Skip to content

Commit

Permalink
Improve sorting in group_entries
Browse files Browse the repository at this point in the history
  • Loading branch information
softins committed Dec 30, 2024
1 parent 4af2b5b commit 54a7968
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions tools/changelog-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export GH_REPO=jamulussoftware/jamulus

PR_LIST_LIMIT=300
TRANSLATION_ENTRY_TEXT="GUI: Translations have been updated:"
TRANSLATION_ENTRY_TEXT2="Translations updated from Hosted Weblate"
declare -A LANGS
LANGS[de_DE]="German"
LANGS[fr_FR]="French"
Expand Down Expand Up @@ -112,32 +113,35 @@ group_entries() {
# Prepend a number to known categories in order to make their sorting position consistent:
category_order=(
"$TRANSLATION_ENTRY_TEXT"
"GUI"
"Accessibility"
"Client"
"Server"
"Recorder"
"Performance"
"CLI"
"Bug Fix"
"Windows"
"Installer"
"Linux"
"Mac"
"Android"
"iOS"
"Translation"
"Doc"
"Website"
"Github"
"Build"
"Autobuild"
"Code"
"Internal"
"$TRANSLATION_ENTRY_TEXT2"
"GUI:"
"Accessibility:"
"Client:"
"Client/Server:"
"Server:"
"Recorder:"
"Performance:"
"CLI:"
"Bug Fix:"
"Windows:"
"Installer:"
"Linux:"
"Mac:"
"Android:"
"iOS:"
"Translation:"
"Doc:"
"Website:"
"Github:"
"Build:"
"Autobuild:"
"Code:"
"Internal:"
)
local index=0
for category in "${category_order[@]}"; do
changelog=$(sed -re 's/^(- '"${category}"')/'"${index}"' \1/' <<< "${changelog}")
# use | as delimiter, as category may contain /
changelog=$(sed -re 's|^(- '"${category}"')|'"${index}"' \1|' <<< "${changelog}")
index=$((index + 1))
done

Expand Down

0 comments on commit 54a7968

Please sign in to comment.