Skip to content

Commit

Permalink
scripts: Fix issue with empty revision (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
hampuslidin authored Dec 19, 2022
1 parent e789acf commit 8bf8ae6
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/bumb_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ def update_changelog(next_version):

changelog_path = os.path.join(REPO_DIR, CHANGELOG_NAME)
last_version, _ = run("git", "-C", REPO_DIR, "rev-list", "--date-order", "--tags", "--max-count=1")
stdout, stderr = run("git", "-C", REPO_DIR, "diff", last_version, "HEAD", "--", CHANGELOG_NAME)

if len(stderr) > 0:
error(stderr.strip())
if len(stdout) == 0:
error("no changes have been made to the changelog")
if len(last_version) > 0:
stdout, stderr = run("git", "-C", REPO_DIR, "diff", last_version, "HEAD", "--", CHANGELOG_NAME)

if len(stderr) > 0:
error(stderr.strip())
if len(stdout) == 0:
error("no changes have been made to the changelog")

with open(changelog_path, "r") as f:
content = f.read()
Expand Down

0 comments on commit 8bf8ae6

Please sign in to comment.