From 7ab0674d8a3b830bb15598cc085786643e21d936 Mon Sep 17 00:00:00 2001 From: BennyKok Date: Thu, 28 Dec 2023 23:56:52 +0800 Subject: [PATCH] chore(plugin): log current comfy deploy revision out --- prestartup_script.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prestartup_script.py b/prestartup_script.py index 5e6ea3b..e5e5ba3 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -45,4 +45,10 @@ class StreamToLogger(): # Redirect stdout and stderr to the logger sys.stdout = StreamToLogger(logging.INFO) -sys.stderr = StreamToLogger(logging.ERROR) \ No newline at end of file +sys.stderr = StreamToLogger(logging.ERROR) + +try: + current_git_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip() + print(f"** Comfy Deploy Revision: {current_git_commit}") +except Exception as e: + print(f"** Comfy Deploy failed to get current git commit: {str(e)}") \ No newline at end of file