mirror of
https://git.datalinker.icu/ltdrdata/ComfyUI-Manager
synced 2025-12-09 22:24:23 +08:00
improve: print log for updated extension
This commit is contained in:
parent
30ee2ceb0f
commit
7688c08000
22
__init__.py
22
__init__.py
@ -55,7 +55,7 @@ sys.path.append('../..')
|
||||
from torchvision.datasets.utils import download_url
|
||||
|
||||
# ensure .js
|
||||
print("### Loading: ComfyUI-Manager (V0.28.1)")
|
||||
print("### Loading: ComfyUI-Manager (V0.28.2)")
|
||||
|
||||
comfy_ui_required_revision = 1240
|
||||
comfy_ui_revision = "Unknown"
|
||||
@ -250,6 +250,10 @@ def __win_check_git_update(path, do_fetch=False, do_update=False):
|
||||
|
||||
if do_update:
|
||||
if "CUSTOM NODE PULL: True" in output:
|
||||
process.wait()
|
||||
print(f"\rUpdated: '{path}'")
|
||||
return True
|
||||
elif "CUSTOM NODE PULL: None" in output:
|
||||
process.wait()
|
||||
return True
|
||||
else:
|
||||
@ -294,17 +298,25 @@ def git_repo_has_updates(path, do_fetch=False, do_update=False):
|
||||
remote_name = 'origin'
|
||||
remote = repo.remote(name=remote_name)
|
||||
|
||||
if do_fetch:
|
||||
# Get the current commit hash
|
||||
commit_hash = repo.head.commit.hexsha
|
||||
|
||||
if do_fetch or do_update:
|
||||
remote.fetch()
|
||||
elif do_update:
|
||||
|
||||
if do_update:
|
||||
try:
|
||||
remote.pull(rebase=True)
|
||||
repo.git.submodule('update', '--init', '--recursive')
|
||||
new_commit_hash = repo.head.commit.hexsha
|
||||
|
||||
if commit_hash != new_commit_hash:
|
||||
print(f"\rUpdated: '{path}'")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Updating failed: '{path}'\n{e}")
|
||||
|
||||
# Get the current commit hash and the commit hash of the remote branch
|
||||
commit_hash = repo.head.commit.hexsha
|
||||
# Get commit hash of the remote branch
|
||||
remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha
|
||||
|
||||
# Compare the commit hashes to determine if the local repository is behind the remote repository
|
||||
|
||||
@ -50,11 +50,17 @@ def gitpull(path):
|
||||
if repo.is_dirty():
|
||||
repo.git.stash()
|
||||
|
||||
commit_hash = repo.head.commit.hexsha
|
||||
try:
|
||||
origin = repo.remote(name='origin')
|
||||
origin.pull(rebase=True)
|
||||
repo.git.submodule('update', '--init', '--recursive')
|
||||
print("CUSTOM NODE PULL: True")
|
||||
new_commit_hash = repo.head.commit.hexsha
|
||||
|
||||
if commit_hash != new_commit_hash:
|
||||
print("CUSTOM NODE PULL: True")
|
||||
else:
|
||||
print("CUSTOM NODE PULL: None")
|
||||
except Exception as e:
|
||||
print(e)
|
||||
print("CUSTOM NODE PULL: False")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user