Skip to content

Commit

Permalink
Fix version checker
Browse files Browse the repository at this point in the history
  • Loading branch information
Jayy001 authored Dec 12, 2024
1 parent 25ae35f commit ad1c636
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions codexctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,12 @@ def call_func(self, function: str, args: dict) -> None:
update_file = version if os.path.isfile(version) else None

version_lookup = lambda version: re.search(r'\b\d+\.\d+\.\d+\.\d+\b', version)

version_number = version_lookup(version)

if not version_number:
version_number = input("Failed to get the version number from the filename, please enter it: ")
if not version_lookup(version_number):
version_number = version_lookup(input("Failed to get the version number from the filename, please enter it: "))
if not version_number:
raise SystemError("Invalid version!")

version_number = version_number.group()
Expand Down

0 comments on commit ad1c636

Please sign in to comment.