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

Commit ec6b3ca

Browse files
committed
fix: Fixes bug looking for version file
Updater was not looking for version file in the correct location.
1 parent 1d4a9ee commit ec6b3ca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitcommit/updater.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import requests
22
import re
3+
import os
34
from prompt_toolkit import print_formatted_text
45
from prompt_toolkit.formatted_text import FormattedText
56
from prompt_toolkit.styles import Style
@@ -19,7 +20,9 @@ def get_github_tags():
1920

2021

2122
def find_version():
22-
with open("gitcommit/__version__.py", "r") as f:
23+
dir_path = os.path.dirname(os.path.realpath(__file__))
24+
version_file_path = os.path.join(dir_path, "__version__.py")
25+
with open(version_file_path, "r") as f:
2326
version_file = f.read()
2427
version_match = re.search(
2528
r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M

0 commit comments

Comments
 (0)