mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-12 03:46:38 +08:00
Fix get version git fallback
This commit is contained in:
parent
21122f9965
commit
d833512213
@ -44,17 +44,17 @@ async def send_socket_catch_exception(function, message):
|
|||||||
|
|
||||||
def get_comfyui_version():
|
def get_comfyui_version():
|
||||||
comfyui_version = "unknown"
|
comfyui_version = "unknown"
|
||||||
|
repo_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
try:
|
try:
|
||||||
import pygit2
|
import pygit2
|
||||||
repo_path = os.path.dirname(os.path.realpath(__file__))
|
|
||||||
repo = pygit2.Repository(repo_path)
|
repo = pygit2.Repository(repo_path)
|
||||||
comfyui_version = repo.describe(describe_strategy=pygit2.GIT_DESCRIBE_TAGS)
|
comfyui_version = repo.describe(describe_strategy=pygit2.GIT_DESCRIBE_TAGS)
|
||||||
except Exception:
|
except Exception:
|
||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path)
|
comfyui_version = subprocess.check_output(["git", "describe", "--tags"], cwd=repo_path)
|
||||||
except Exception:
|
except Exception as e:
|
||||||
pass
|
logging.warning(f"Failed to get ComfyUI version: {e}")
|
||||||
return comfyui_version.strip()
|
return comfyui_version.strip()
|
||||||
|
|
||||||
@web.middleware
|
@web.middleware
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user