From d9f83dadd1acf36133a2e81301488a2b1672ffb4 Mon Sep 17 00:00:00 2001 From: BennyKok Date: Fri, 29 Dec 2023 00:09:52 +0800 Subject: [PATCH] fix: ensure the correct path when logging out version --- prestartup_script.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prestartup_script.py b/prestartup_script.py index e5e5ba3..e2f412a 100644 --- a/prestartup_script.py +++ b/prestartup_script.py @@ -48,6 +48,10 @@ sys.stdout = StreamToLogger(logging.INFO) sys.stderr = StreamToLogger(logging.ERROR) try: + # Get the absolute path of the script's directory + script_dir = os.path.dirname(os.path.abspath(__file__)) + # Change the current working directory to the script's directory + os.chdir(script_dir) 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: