mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-11-06 01:12:27 +00:00
Git : replace commit_hash when it is set in config_terminal
This commit is contained in:
1
build/pyinstaller/GTFF_DEFAULTS.json
vendored
1
build/pyinstaller/GTFF_DEFAULTS.json
vendored
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user