mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2025-04-10 19:15:12 +00:00
CHANGELOG: fixed dialog
This commit is contained in:
parent
e24cf46f8f
commit
ed136a983c
|
@ -168,22 +168,24 @@ changelog_dialog() {
|
||||||
log d "Showing changelog dialog"
|
log d "Showing changelog dialog"
|
||||||
|
|
||||||
if [[ "$1" == "all" ]]; then
|
if [[ "$1" == "all" ]]; then
|
||||||
xml sel -t -m "//release" -v "concat('RetroDECK version: ', @version)" -n -v "description" -n $rd_appdata | awk '{$1=$1;print}' | sed -e '/./b' -e :n -e 'N;s/\n$//;tn' > "/var/config/retrodeck/changelog.txt"
|
xml sel -t -m "//component/releases/release/description" -c . $rd_appdata | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog-full.xml"
|
||||||
|
|
||||||
|
convert_to_markdown "/var/config/retrodeck/changelog-full.xml"
|
||||||
|
|
||||||
rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \
|
rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Changelogs" \
|
--title "RetroDECK Changelogs" \
|
||||||
--filename="/var/config/retrodeck/changelog.txt"
|
--filename="/var/config/retrodeck/changelog-full.xml.md"
|
||||||
else
|
else
|
||||||
local version_changelog=$(xml sel -t -m "//release[@version='$1']/description" -v . -n $rd_appdata | tr -s '\n' | sed 's/^\s*//')
|
xml sel -t -m "//component/releases/release[1]/description" -c . $rd_appdata | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog.xml"
|
||||||
|
|
||||||
echo -e "In RetroDECK version $1, the following changes were made:\n$version_changelog" > "/var/config/retrodeck/changelog-partial.txt" 2>/dev/null
|
convert_to_markdown "/var/config/retrodeck/changelog.xml"
|
||||||
|
|
||||||
rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \
|
rd_zenity --icon-name=net.retrodeck.retrodeck --text-info --width=1200 --height=720 \
|
||||||
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
||||||
--title "RetroDECK Changelogs" \
|
--title "RetroDECK Changelogs" \
|
||||||
--filename="/var/config/retrodeck/changelog-partial.txt"
|
--filename="/var/config/retrodeck/changelog.xml.md"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
get_cheevos_token_dialog() {
|
get_cheevos_token_dialog() {
|
||||||
|
|
|
@ -952,3 +952,19 @@ start_retrodeck() {
|
||||||
log i "Starting RetroDECK v$version"
|
log i "Starting RetroDECK v$version"
|
||||||
es-de
|
es-de
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to convert XML tags to Markdown
|
||||||
|
convert_to_markdown() {
|
||||||
|
local xml_content=$(cat "$1")
|
||||||
|
local output_file="$1.md"
|
||||||
|
|
||||||
|
# Convert main tags
|
||||||
|
echo "$xml_content" | xmllint --format - | \
|
||||||
|
sed -e 's|<p>\(.*\)</p>|**\1**|g' \
|
||||||
|
-e 's|<ul>||g' \
|
||||||
|
-e 's|</ul>||g' \
|
||||||
|
-e 's|<li>\(.*\)</li>|- \1|g' \
|
||||||
|
-e 's|<description>||g' \
|
||||||
|
-e 's|</description>||g' \
|
||||||
|
-e '/<[^>]*>/d' > "$output_file" # Remove any other XML tags and output to .md file
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue