better way if manually updated
This commit is contained in:
parent
0588180dda
commit
3385540350
6
main.py
6
main.py
|
@ -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}")
|
||||||
|
|
|
@ -9,3 +9,4 @@ pyvirtualdisplay
|
||||||
pillow
|
pillow
|
||||||
EasyProcess
|
EasyProcess
|
||||||
pyotp
|
pyotp
|
||||||
|
packaging
|
||||||
|
|
Loading…
Reference in New Issue