Skip to content

Commit

Permalink
fix updater logic
Browse files Browse the repository at this point in the history
  • Loading branch information
craftnut committed May 6, 2024
1 parent b3b60da commit 9a43213
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
from pathlib import Path
import urllib.request

version = '1.0-1' # CHANGE TO VERSION NUMBER FOR RELEASE COMMITS!!!!
version = '1.0-2' # CHANGE TO VERSION NUMBER FOR RELEASE COMMITS!!!!

with urllib.request.urlopen("https://api.github.com/repos/craftnut/GZLauncher/tags") as tags:
tags = json.load(tags)
print(tags)
latest_version = tags[0]
print(len(tags) - 1)

last = len(tags) - 1
latest_version = tags[last]

version_num = latest_version['name']
dl_url = latest_version['zipball_url']
Expand All @@ -26,7 +29,7 @@

elif version_num != version:

update = input('New version {version_num} available, would you like to update? (Y, n)')
update = input(f'New version {version_num} available, would you like to update? (Y, n)')

if update in ['Y', '']:
temp_dir = Path("./temp")
Expand Down

0 comments on commit 9a43213

Please sign in to comment.