mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Ensure appdata releases tag is replaced rather than added
This commit is contained in:
parent
6af255923a
commit
4ca3f6a1b3
1 changed files with 5 additions and 1 deletions
|
@ -54,7 +54,11 @@ def get_changelog_xml(changelog, max_items=None):
|
||||||
|
|
||||||
def update_appdata(appdata_path, changelog, max_items=None):
|
def update_appdata(appdata_path, changelog, max_items=None):
|
||||||
appdata = ET.parse(appdata_path)
|
appdata = ET.parse(appdata_path)
|
||||||
appdata.getroot().append(
|
root = appdata.getroot()
|
||||||
|
releases = root.find("releases")
|
||||||
|
if releases is not None:
|
||||||
|
root.remove(releases)
|
||||||
|
root.append(
|
||||||
get_changelog_xml(changelog, max_items)
|
get_changelog_xml(changelog, max_items)
|
||||||
)
|
)
|
||||||
appdata.write(appdata_path, encoding="utf-8", xml_declaration=True)
|
appdata.write(appdata_path, encoding="utf-8", xml_declaration=True)
|
||||||
|
|
Loading…
Add table
Reference in a new issue