diff --git a/build/pyinstaller/GTFF_DEFAULTS.json b/build/pyinstaller/GTFF_DEFAULTS.json index b2a49d4a23f..b94e4afd5ce 100644 --- a/build/pyinstaller/GTFF_DEFAULTS.json +++ b/build/pyinstaller/GTFF_DEFAULTS.json @@ -1,5 +1,6 @@ { "GTFF_PACKAGED_APPLICATION": "True", + "GT_LOGGING_COMMIT_HASH": "938e9be", "GTFF_ENABLE_PREDICT": "False", "GTFF_ENABLE_CHECK_API": "True", "GTFF_ENABLE_THOUGHTS_DAY": "False", diff --git a/gamestonk_terminal/config_terminal.py b/gamestonk_terminal/config_terminal.py index f0a4f94746d..3a0a824638a 100644 --- a/gamestonk_terminal/config_terminal.py +++ b/gamestonk_terminal/config_terminal.py @@ -26,6 +26,7 @@ PAPERMILL_NOTEBOOK_REPORT_PORT = ( # USE IN LOG LINES + FOR FOLDER NAME INSIDE S3 BUCKET LOGGING_APP_NAME = os.getenv("GT_LOGGING_APP_NAME") or "gst" +LOGGING_COMMIT_HASH = os.getenv("GT_LOGGING_COMMIT_HASH") or "REPLACE_ME" # D | H | M | S LOGGING_FREQUENCY = os.getenv("GT_LOGGING_FREQUENCY") or "H" # stdout,stderr,noop,file diff --git a/gamestonk_terminal/loggers.py b/gamestonk_terminal/loggers.py index c05503e0130..99ee459e574 100644 --- a/gamestonk_terminal/loggers.py +++ b/gamestonk_terminal/loggers.py @@ -46,6 +46,9 @@ def get_app_id() -> str: def get_commit_hash() -> str: """Get Commit Short Hash""" + if cfg.LOGGING_COMMIT_HASH != "REPLACE_ME": + return cfg.LOGGING_COMMIT_HASH + file_path = Path(__file__) git_dir = file_path.parent.parent.absolute().joinpath(".git") diff --git a/gamestonk_terminal/terminal_helper.py b/gamestonk_terminal/terminal_helper.py index 538341d8711..eef83afecc6 100644 --- a/gamestonk_terminal/terminal_helper.py +++ b/gamestonk_terminal/terminal_helper.py @@ -13,6 +13,7 @@ from typing import List import ascii_magic import matplotlib.pyplot as plt +import gamestonk_terminal.config_terminal as cfg from gamestonk_terminal import feature_flags as gtff from gamestonk_terminal import thought_of_the_day as thought from gamestonk_terminal.rich_config import console @@ -66,6 +67,10 @@ def sha256sum(filename): def update_terminal(): """Updates the terminal by running git pull in the directory. Runs poetry install if needed""" + + if cfg.LOGGING_COMMIT_HASH != "REPLACE_ME": + return cfg.LOGGING_COMMIT_HASH + poetry_hash = sha256sum("poetry.lock") completed_process = subprocess.run("git pull", shell=True, check=False) # nosec