mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 05:55:38 +00:00
Uploading last version of this broken tool [skip ci]
This commit is contained in:
parent
aa2a2b453b
commit
2b450ad5e1
|
@ -58,61 +58,25 @@ version_number="${version_number%% -*}" # Remove text after " - "
|
||||||
# Extract sections from the latest version notes
|
# Extract sections from the latest version notes
|
||||||
sections=$(echo "$latest_version_notes" | awk '/##/ { print; }')
|
sections=$(echo "$latest_version_notes" | awk '/##/ { print; }')
|
||||||
|
|
||||||
# # Create a formatted section list
|
# Create a formatted section list
|
||||||
# section_list=""
|
section_list=""
|
||||||
# current_section=""
|
|
||||||
# while IFS= read -r line; do
|
|
||||||
# if [[ "$line" == "##"* ]]; then
|
|
||||||
# if [ -n "$current_section" ]; then
|
|
||||||
# section_list+="</ul>"
|
|
||||||
# fi
|
|
||||||
# section_name="${line##*# }"
|
|
||||||
# section_list+="<p>${section_name}</p><ul>"
|
|
||||||
# elif [[ "$line" == "- "* ]]; then
|
|
||||||
# entry="${line#*- }"
|
|
||||||
# section_list+="<li>${entry}</li>"
|
|
||||||
# fi
|
|
||||||
# done <<< "$sections"
|
|
||||||
|
|
||||||
# if [ -n "$current_section" ]; then
|
|
||||||
# section_list+="</ul>"
|
|
||||||
# fi
|
|
||||||
|
|
||||||
altered_sections=""
|
|
||||||
current_section=""
|
current_section=""
|
||||||
in_list=0
|
while IFS= read -r line; do
|
||||||
|
if [[ "$line" == "##"* ]]; then
|
||||||
IFS=$'\n'
|
|
||||||
for line in $sections; do
|
|
||||||
if [[ $line =~ ^##\ (.+) ]]; then
|
|
||||||
if [ -n "$current_section" ]; then
|
if [ -n "$current_section" ]; then
|
||||||
if [ $in_list -eq 1 ]; then
|
section_list+="</ul>"
|
||||||
altered_sections+="</ul>\n"
|
|
||||||
in_list=0
|
|
||||||
fi
|
|
||||||
altered_sections+="</ul>\n"
|
|
||||||
fi
|
|
||||||
current_section="${BASH_REMATCH[1]}"
|
|
||||||
altered_sections+="<p>$current_section</p>\n<ul>\n"
|
|
||||||
elif [[ $line =~ ^-\ (.+) ]]; then
|
|
||||||
if [ $in_list -eq 0 ]; then
|
|
||||||
in_list=1
|
|
||||||
altered_sections+="<ul>\n"
|
|
||||||
fi
|
|
||||||
list_item="${BASH_REMATCH[1]}"
|
|
||||||
altered_sections+="<li>$list_item</li>\n"
|
|
||||||
elif [ -z "$line" ]; then
|
|
||||||
if [ $in_list -eq 1 ]; then
|
|
||||||
in_list=0
|
|
||||||
altered_sections+="</ul>\n"
|
|
||||||
fi
|
fi
|
||||||
|
section_name="${line##*# }"
|
||||||
|
section_list+="<p>${section_name}</p><ul>"
|
||||||
|
elif [[ "$line" == "- "* ]]; then
|
||||||
|
entry="${line#*- }"
|
||||||
|
section_list+="<li>${entry}</li>"
|
||||||
fi
|
fi
|
||||||
done
|
done <<< "$sections"
|
||||||
if [ $in_list -eq 1 ]; then
|
|
||||||
altered_sections+="</ul>\n"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "$altered_sections"
|
if [ -n "$current_section" ]; then
|
||||||
|
section_list+="</ul>"
|
||||||
|
fi
|
||||||
|
|
||||||
# Replace RELEASE_NOTES_PLACEHOLDER with the actual release notes
|
# Replace RELEASE_NOTES_PLACEHOLDER with the actual release notes
|
||||||
release_description="${release_snippet/RELEASE_NOTES_PLACEHOLDER/$section_list}"
|
release_description="${release_snippet/RELEASE_NOTES_PLACEHOLDER/$section_list}"
|
||||||
|
|
Loading…
Reference in a new issue