fix: messages

This commit is contained in:
Dr.Lt.Data 2023-09-19 10:14:14 +09:00
parent 7688c08000
commit 0977ef97f3
2 changed files with 36 additions and 28 deletions

View File

@ -55,7 +55,7 @@ sys.path.append('../..')
from torchvision.datasets.utils import download_url from torchvision.datasets.utils import download_url
# ensure .js # ensure .js
print("### Loading: ComfyUI-Manager (V0.28.2)") print("### Loading: ComfyUI-Manager (V0.28.3)")
comfy_ui_required_revision = 1240 comfy_ui_required_revision = 1240
comfy_ui_revision = "Unknown" comfy_ui_revision = "Unknown"
@ -251,21 +251,24 @@ def __win_check_git_update(path, do_fetch=False, do_update=False):
if do_update: if do_update:
if "CUSTOM NODE PULL: True" in output: if "CUSTOM NODE PULL: True" in output:
process.wait() process.wait()
print(f"\rUpdated: '{path}'") print(f"\rUpdated: {path}")
return True return True
elif "CUSTOM NODE PULL: None" in output: elif "CUSTOM NODE PULL: None" in output:
process.wait() process.wait()
return True return True
else: else:
print(f"{output}") print(f"\rUpdate error: {path}")
process.wait() process.wait()
return False return False
else: else:
if "CUSTOM NODE CHECK: True" in output: if "CUSTOM NODE CHECK: True" in output:
process.wait() process.wait()
return True return True
elif "CUSTOM NODE CHECK: False" in output:
process.wait()
return False
else: else:
print(f"{output}") print(f"\rFetch error: {path}")
process.wait() process.wait()
return False return False
@ -278,9 +281,9 @@ def __win_check_git_pull(path):
def git_repo_has_updates(path, do_fetch=False, do_update=False): def git_repo_has_updates(path, do_fetch=False, do_update=False):
if do_fetch: if do_fetch:
print(f"\rFetching: {path}", end='') print(f"\x1b[2K\rFetching: {path}", end='')
elif do_update: elif do_update:
print(f"\rUpdating: {path}", end='') print(f"\x1b[2K\rUpdating: {path}", end='')
# Check if the path is a git repository # Check if the path is a git repository
if not os.path.exists(os.path.join(path, '.git')): if not os.path.exists(os.path.join(path, '.git')):
@ -311,7 +314,7 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False):
new_commit_hash = repo.head.commit.hexsha new_commit_hash = repo.head.commit.hexsha
if commit_hash != new_commit_hash: if commit_hash != new_commit_hash:
print(f"\rUpdated: '{path}'") print(f"\x1b[2K\rUpdated: '{path}'")
except Exception as e: except Exception as e:
print(f"Updating failed: '{path}'\n{e}") print(f"Updating failed: '{path}'\n{e}")

View File

@ -12,6 +12,7 @@ def gitclone(custom_nodes_path, url):
repo.close() repo.close()
def gitcheck(path, do_fetch=False): def gitcheck(path, do_fetch=False):
try:
# Fetch the latest commits from the remote repository # Fetch the latest commits from the remote repository
repo = git.Repo(path) repo = git.Repo(path)
@ -39,6 +40,10 @@ def gitcheck(path, do_fetch=False):
print("CUSTOM NODE CHECK: True") print("CUSTOM NODE CHECK: True")
else: else:
print("CUSTOM NODE CHECK: False") print("CUSTOM NODE CHECK: False")
except Exception as e:
print(e)
print("CUSTOM NODE CHECK: Error")
def gitpull(path): def gitpull(path):
# Check if the path is a git repository # Check if the path is a git repository