mirror of
https://github.com/telegramdesktop/tdesktop
synced 2024-12-13 09:54:54 +00:00
Ensure appdata releases tag is replaced rather than added
This commit is contained in:
parent
6af255923a
commit
4ca3f6a1b3
@ -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…
Reference in New Issue
Block a user