fix: ensure the correct path when logging out version

This commit is contained in:
BennyKok 2023-12-29 00:09:52 +08:00
parent 7ab0674d8a
commit d9f83dadd1

View File

@ -48,6 +48,10 @@ sys.stdout = StreamToLogger(logging.INFO)
sys.stderr = StreamToLogger(logging.ERROR) sys.stderr = StreamToLogger(logging.ERROR)
try: 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() current_git_commit = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip()
print(f"** Comfy Deploy Revision: {current_git_commit}") print(f"** Comfy Deploy Revision: {current_git_commit}")
except Exception as e: except Exception as e: