mirror of
https://github.com/ihabunek/twitch-dl
synced 2024-08-30 18:32:25 +00:00
Add support for version description in changelog
This commit is contained in:
parent
71ae2bf906
commit
8be0aba95d
@ -21,6 +21,13 @@ for version in data.keys():
|
|||||||
changes = data[version]["changes"]
|
changes = data[version]["changes"]
|
||||||
print(f"### [{version} ({date})](https://github.com/ihabunek/twitch-dl/releases/tag/{version})")
|
print(f"### [{version} ({date})](https://github.com/ihabunek/twitch-dl/releases/tag/{version})")
|
||||||
print()
|
print()
|
||||||
|
|
||||||
|
if "description" in data[version]:
|
||||||
|
description = data[version]["description"].strip()
|
||||||
|
for line in textwrap.wrap(description, 80):
|
||||||
|
print(line)
|
||||||
|
print()
|
||||||
|
|
||||||
for c in changes:
|
for c in changes:
|
||||||
lines = textwrap.wrap(c, 78)
|
lines = textwrap.wrap(c, 78)
|
||||||
initial = True
|
initial = True
|
||||||
|
@ -44,14 +44,18 @@ if dist_version != version:
|
|||||||
|
|
||||||
release_date = changelog_item["date"]
|
release_date = changelog_item["date"]
|
||||||
changes = changelog_item["changes"]
|
changes = changelog_item["changes"]
|
||||||
|
description = changelog_item["description"] if "description" in changelog_item else None
|
||||||
|
|
||||||
if not isinstance(release_date, date):
|
if not isinstance(release_date, date):
|
||||||
print(f"Release date not set for version `{version}` in the changelog.", file=sys.stderr)
|
print(f"Release date not set for version `{version}` in the changelog.", file=sys.stderr)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
commit_message = f"twitch-dl {version}\n\n"
|
commit_message = f"twitch-dl {version}\n\n"
|
||||||
|
if description:
|
||||||
|
lines = textwrap.wrap(description.strip(), 72)
|
||||||
|
commit_message += "\n".join(lines) + "\n\n"
|
||||||
for c in changes:
|
for c in changes:
|
||||||
lines = textwrap.wrap(c, 70)
|
lines = textwrap.wrap(c, 69)
|
||||||
initial = True
|
initial = True
|
||||||
for line in lines:
|
for line in lines:
|
||||||
lead = " *" if initial else " "
|
lead = " *" if initial else " "
|
||||||
|
Loading…
Reference in New Issue
Block a user