Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 2a9701e

Browse files
committed
fix(updater): Correctly evaluates version updates
This fixes an issue which would not recognise when the user is running a version which is higher than the latest tag version on GitHub. Fix #42
1 parent 57d8de3 commit 2a9701e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitcommit/updater.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from prompt_toolkit.styles import Style
77
from .ansi import ANSI as Ansi
88
import pyperclip # pylint: disable=import-error
9+
from packaging import version
910

1011

1112
def get_github_tags():
@@ -38,7 +39,7 @@ def check_for_update():
3839
latest_tag_version = tags[0][1:]
3940
cur_version = find_version()
4041

41-
if latest_tag_version != cur_version:
42+
if version.parse(cur_version) < version.parse(latest_tag_version):
4243
Ansi.print_ok("There is an update available for conventional-commit.")
4344
upgrade_command = "pip install --upgrade conventional-commit"
4445
pyperclip.copy(upgrade_command)

0 commit comments

Comments
 (0)