Skip to content

Commit

Permalink
Revert "Removed unnecessary indentation blocks and updated conditiona…
Browse files Browse the repository at this point in the history
…l statements."

This reverts commit 4a6dd9a.
  • Loading branch information
niklasf committed Oct 4, 2024
1 parent 30d9910 commit 46c2888
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
def system(command):
print(command)
exit_code = os.system(command)
if exit_code:
if exit_code != 0:
sys.exit(exit_code)


Expand All @@ -21,7 +21,7 @@ def check_git():

system("git fetch origin")
behind = int(subprocess.check_output(["git", "rev-list", "--count", "master..origin/master"]))
if behind:
if behind > 0:
print(f"master is {behind} commit(s) behind origin/master")
sys.exit(1)

Expand Down Expand Up @@ -65,14 +65,15 @@ def tag_and_push():
release_txt.write(headline + os.linesep)

for line in changelog_file:
if line.startswith("-------") and not first_section:
first_section = True
if not first_section:
if line.startswith("-------"):
first_section = True
else:
if line.startswith("-------"):
break

if not prev_line.startswith("------"):
release_txt.write(prev_line)
else:
if not prev_line.startswith("------"):
release_txt.write(prev_line)

prev_line = line

Expand Down

0 comments on commit 46c2888

Please sign in to comment.