quick update not sure if it even works

This commit is contained in:
WhatDidYouExpect 2025-07-07 01:18:51 +02:00
parent 2da96015e9
commit fdf78f8d13
2 changed files with 7 additions and 2 deletions

View file

@ -37,7 +37,7 @@ arch = platform.machine()
slash_commands_enabled = True # 100% broken, its a newer enough version so its probably enabled by default.... fix this at somepoint or hard code it in goober central code slash_commands_enabled = True # 100% broken, its a newer enough version so its probably enabled by default.... fix this at somepoint or hard code it in goober central code
launched = False launched = False
latest_version = "0.0.0" latest_version = "0.0.0"
local_version = "2.0.0" local_version = "2.0.1"
os.environ['gooberlocal_version'] = local_version os.environ['gooberlocal_version'] = local_version
REACT = os.getenv("REACT") REACT = os.getenv("REACT")
beta = False # this makes goober think its a beta version, so it will not update to the latest stable version or run any version checks beta = False # this makes goober think its a beta version, so it will not update to the latest stable version or run any version checks

View file

@ -4,6 +4,8 @@ import requests
import subprocess import subprocess
import sys import sys
launched = False
# Run a shell command and return its output # Run a shell command and return its output
def run_cmd(cmd): def run_cmd(cmd):
result = subprocess.run(cmd, shell=True, capture_output=True, text=True) result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
@ -17,6 +19,8 @@ def is_remote_ahead(branch='main', remote='origin'):
# Automatically update the local repository if the remote is ahead # Automatically update the local repository if the remote is ahead
def auto_update(branch='main', remote='origin'): def auto_update(branch='main', remote='origin'):
if launched == True:
return
if launched == True: if launched == True:
print(_("already_started")) print(_("already_started"))
return return
@ -48,7 +52,7 @@ def get_latest_version_info():
def check_for_update(): def check_for_update():
if ALIVEPING != "True": if ALIVEPING != "True":
return return
global latest_version, local_version global latest_version, local_version, launched
latest_version_info = get_latest_version_info() latest_version_info = get_latest_version_info()
if not latest_version_info: if not latest_version_info:
@ -80,4 +84,5 @@ def check_for_update():
elif local_version == latest_version: elif local_version == latest_version:
print(f"{GREEN}{_('latest_version')} {local_version}{RESET}") print(f"{GREEN}{_('latest_version')} {local_version}{RESET}")
print(f"{_('latest_version2').format(VERSION_URL=VERSION_URL)}\n\n") print(f"{_('latest_version2').format(VERSION_URL=VERSION_URL)}\n\n")
launched = True
return latest_version return latest_version