simplified the fuckin version checks ffs
This commit is contained in:
parent
dac9c34cc8
commit
2efe8df593
2 changed files with 13 additions and 14 deletions
25
bot.py
25
bot.py
|
@ -173,7 +173,7 @@ def generate_sha256_of_current_file():
|
||||||
|
|
||||||
|
|
||||||
latest_version = "0.0.0"
|
latest_version = "0.0.0"
|
||||||
local_version = "0.14.8.3.1"
|
local_version = "0.14.8.3.3"
|
||||||
os.environ['gooberlocal_version'] = local_version
|
os.environ['gooberlocal_version'] = local_version
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,24 +195,23 @@ def check_for_update():
|
||||||
print(f"{RED}{get_translation(LOCALE, 'invalid_server')}{RESET}")
|
print(f"{RED}{get_translation(LOCALE, 'invalid_server')}{RESET}")
|
||||||
return None, None
|
return None, None
|
||||||
|
|
||||||
if local_version == "0.0.0":
|
if local_version == "0.0.0" or None:
|
||||||
with open(LOCAL_VERSION_FILE, "w") as f:
|
print(f"{RED}I cant find the local_version variable! Or its been tampered with and its not an interger!{RESET}")
|
||||||
f.write(latest_version)
|
return
|
||||||
|
|
||||||
generate_sha256_of_current_file()
|
generate_sha256_of_current_file()
|
||||||
gooberhash = latest_version_info.get("hash")
|
gooberhash = latest_version_info.get("hash")
|
||||||
if gooberhash == currenthash:
|
if local_version < latest_version:
|
||||||
if local_version < latest_version:
|
print(f"{YELLOW}{get_translation(LOCALE, 'new_version').format(latest_version=latest_version, local_version=local_version)}{RESET}")
|
||||||
print(f"{YELLOW}{get_translation(LOCALE, 'new_version').format(latest_version=latest_version, local_version=local_version)}{RESET}")
|
print(f"{YELLOW}{get_translation(LOCALE, 'changelog').format(VERSION_URL=VERSION_URL)}{RESET}")
|
||||||
print(f"{YELLOW}{get_translation(LOCALE, 'changelog').format(VERSION_URL=VERSION_URL)}{RESET}")
|
if local_version == latest_version:
|
||||||
else:
|
print(f"{GREEN}{get_translation(LOCALE, 'latest_version')} {local_version}{RESET}")
|
||||||
print(f"{GREEN}{get_translation(LOCALE, 'latest_version')} {local_version}{RESET}")
|
print(f"{get_translation(LOCALE, 'latest_version2').format(VERSION_URL=VERSION_URL)}\n\n")
|
||||||
print(f"{get_translation(LOCALE, 'latest_version2').format(VERSION_URL=VERSION_URL)}\n\n")
|
if gooberhash != currenthash:
|
||||||
else:
|
|
||||||
print(f"{YELLOW}{get_translation(LOCALE, 'modification_warning')}")
|
print(f"{YELLOW}{get_translation(LOCALE, 'modification_warning')}")
|
||||||
print(f"{YELLOW}{get_translation(LOCALE, 'reported_version')} {local_version}{RESET}")
|
print(f"{YELLOW}{get_translation(LOCALE, 'reported_version')} {local_version}{RESET}")
|
||||||
print(f"{DEBUG}{get_translation(LOCALE, 'current_hash')} {currenthash}{RESET}")
|
print(f"{DEBUG}{get_translation(LOCALE, 'current_hash')} {currenthash}{RESET}")
|
||||||
|
|
||||||
|
|
||||||
check_for_update()
|
check_for_update()
|
||||||
|
|
||||||
def get_file_info(file_path):
|
def get_file_info(file_path):
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"modification_warning": "Goober has been modified! Skipping server checks entirely...",
|
"modification_warning": "Goober has been modified! Any changes will be lost in an update!",
|
||||||
"reported_version": "Reported Version:",
|
"reported_version": "Reported Version:",
|
||||||
"current_hash": "Current Hash:",
|
"current_hash": "Current Hash:",
|
||||||
"not_found": "is not found!",
|
"not_found": "is not found!",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue