Skip to content

Commit

Permalink
Fix changelogs that only contain one version
Browse files Browse the repository at this point in the history
Fixes #1
  • Loading branch information
kemayo committed Jul 27, 2024
1 parent edbb8f5 commit ef29a6a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ def main(full_changelog, output):
for line in f:
if line.startswith('##') and not line.startswith('###'):
if matching:
print("Wrote changelog to", output)
return
return output
matching = True
if matching:
out.write(line)
if matching:
# There was only one version in the changelog, so we hit the end of
# the file while still matching
return output
sys.exit("Couldn't write changelog")

if __name__ == '__main__':
main(sys.argv[1], sys.argv[2])
output = main(sys.argv[1], sys.argv[2])
print("Wrote changelog to", output)

0 comments on commit ef29a6a

Please sign in to comment.