better way if manually updated

This commit is contained in:
piair 2023-04-04 20:50:56 +02:00
parent 0588180dda
commit 3385540350
3 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#/usr/bin/python3.10 #/usr/bin/python3.10
from packaging.version import parse as parse_version
import configparser import configparser
import os import os
import shutil import shutil
@ -157,13 +157,15 @@ def proxy() :
def check_update(): def check_update():
try : try :
latest = requests.get("https://api.github.com/repos/piair338/MsRewards/releases").json()[0]["tag_name"] latest = requests.get("https://api.github.com/repos/piair338/MsRewards/releases").json()[0]["tag_name"]
latest = parse_version(latest)
except Exception as e : except Exception as e :
print(e) print(e)
return () return ()
f = open("./version", 'r') f = open("./version", 'r')
txt = f.readlines()[0].replace("\n","") txt = f.readlines()[0].replace("\n","")
f.close() f.close()
if (txt == latest) : cur = parse_version(txt)
if (cur < latest) :
print("Already up to date.") print("Already up to date.")
else : else :
print(f"updating to {latest}") print(f"updating to {latest}")

View File

@ -8,4 +8,5 @@ requests
pyvirtualdisplay pyvirtualdisplay
pillow pillow
EasyProcess EasyProcess
pyotp pyotp
packaging

View File

@ -1 +1 @@
v5.1.1 v5.1.2