From 2b450ad5e12d81c0c60667b4adce3ae814d21a53 Mon Sep 17 00:00:00 2001 From: XargonWan Date: Thu, 31 Aug 2023 14:43:38 +0200 Subject: [PATCH] Uploading last version of this broken tool [skip ci] --- automation_tools/appdata_management.sh | 64 ++++++-------------------- 1 file changed, 14 insertions(+), 50 deletions(-) diff --git a/automation_tools/appdata_management.sh b/automation_tools/appdata_management.sh index 29fa7cf5..a59fdfb9 100755 --- a/automation_tools/appdata_management.sh +++ b/automation_tools/appdata_management.sh @@ -58,61 +58,25 @@ version_number="${version_number%% -*}" # Remove text after " - " # Extract sections from the latest version notes sections=$(echo "$latest_version_notes" | awk '/##/ { print; }') -# # Create a formatted section list -# section_list="" -# current_section="" -# while IFS= read -r line; do -# if [[ "$line" == "##"* ]]; then -# if [ -n "$current_section" ]; then -# section_list+="" -# fi -# section_name="${line##*# }" -# section_list+="

${section_name}

" -# fi - -altered_sections="" +# Create a formatted section list +section_list="" current_section="" -in_list=0 - -IFS=$'\n' -for line in $sections; do - if [[ $line =~ ^##\ (.+) ]]; then +while IFS= read -r line; do + if [[ "$line" == "##"* ]]; then if [ -n "$current_section" ]; then - if [ $in_list -eq 1 ]; then - altered_sections+="\n" - in_list=0 - fi - altered_sections+="\n" - fi - current_section="${BASH_REMATCH[1]}" - altered_sections+="

$current_section

\n" fi + section_name="${line##*# }" + section_list+="

${section_name}

\n" -fi +done <<< "$sections" -echo -e "$altered_sections" +if [ -n "$current_section" ]; then + section_list+="" +fi # Replace RELEASE_NOTES_PLACEHOLDER with the actual release notes release_description="${release_snippet/RELEASE_NOTES_PLACEHOLDER/$section_list}"