diff --git a/build/pyinstaller/GTFF_DEFAULTS.json b/build/pyinstaller/GTFF_DEFAULTS.json index b94e4afd5ce..123ab83f2de 100644 --- a/build/pyinstaller/GTFF_DEFAULTS.json +++ b/build/pyinstaller/GTFF_DEFAULTS.json @@ -1,6 +1,6 @@ { "GTFF_PACKAGED_APPLICATION": "True", - "GT_LOGGING_COMMIT_HASH": "938e9be", + "GT_LOGGING_COMMIT_HASH": "sha:15bde4e2", "GTFF_ENABLE_PREDICT": "False", "GTFF_ENABLE_CHECK_API": "True", "GTFF_ENABLE_THOUGHTS_DAY": "False", @@ -27,4 +27,4 @@ "GTFF_OPEN_REPORT_AS_HTML": "True", "GTFF_ENABLE_QUICK_EXIT": "False", "GTFF_ENABLE_EXIT_AUTO_HELP": "False" -} +} \ No newline at end of file diff --git a/build/pyinstaller/terminal.spec b/build/pyinstaller/terminal.spec index 19a9f0da136..61678040f37 100644 --- a/build/pyinstaller/terminal.spec +++ b/build/pyinstaller/terminal.spec @@ -1,12 +1,15 @@ # -*- mode: python ; coding: utf-8 -*- import os import sys +import json from PyInstaller.compat import is_darwin, is_win from PyInstaller.building.api import PYZ, EXE, COLLECT from PyInstaller.building.splash import Splash from PyInstaller.building.build_main import Analysis +from gamestonk_terminal.loggers import get_commit_hash + NAME = "GamestonkTerminal" build_type = ( @@ -18,6 +21,17 @@ pathex = os.path.join( os.path.dirname(sys.executable), "..", "lib", "python3.8", "site-packages" ) +# Get latest commit +commit_hash = get_commit_hash() +build_assets_folder = os.path.join(os.getcwd(), "build", "pyinstaller") +default_feature_flags_path = os.path.join(build_assets_folder, "GTFF_DEFAULTS.json") +with open(default_feature_flags_path, "r") as f: + default_gtff = json.load(f) + +default_gtff["GT_LOGGING_COMMIT_HASH"] = commit_hash +with open(default_feature_flags_path, "w") as f: + json.dump(default_gtff, f, indent=4) + # Files that are explicitly pulled into the bundle added_files = [ (os.path.join(os.getcwd(), "gamestonk_terminal"), "gamestonk_terminal"),