Browse Source

fix: display command instead of fixing.

pull/242/head
dr.lt.data 11 months ago
parent
commit
ffc19c0d07
  1. 14
      __init__.py
  2. 6
      prestartup_script.py

14
__init__.py

@ -20,7 +20,7 @@ import nodes
import torch
version = [1, 13, 5]
version = [1, 13, 6]
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
print(f"### Loading: ComfyUI-Manager ({version_str})")
@ -316,6 +316,12 @@ def __win_check_git_update(path, do_fetch=False, do_update=False):
except Exception as e:
print(f'[ComfyUI-Manager] failed to fixing')
if 'detected dubious' in output:
print(f'\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n'
f'-----------------------------------------------------------------------------------------\n'
f'git config --global --add safe.directory "{path}"\n'
f'-----------------------------------------------------------------------------------------\n')
if do_update:
if "CUSTOM NODE PULL: True" in output:
process.wait()
@ -1482,7 +1488,13 @@ async def update_comfyui(request):
if 'detected dubious' in e:
print(f"[ComfyUI-Manager] Try fixing 'dubious repository' error on 'ComfyUI' repository")
subprocess.run(['git', 'config', '--global', '--add', 'safe.directory', comfy_path])
try:
remote.fetch()
except Exception:
print(f"\n[ComfyUI-Manager] Failed to fixing repository setup. Please execute this command on cmd: \n"
f"-----------------------------------------------------------------------------------------\n"
f'git config --global --add safe.directory "{comfy_path}"\n'
f"-----------------------------------------------------------------------------------------\n")
commit_hash = repo.head.commit.hexsha
remote_commit_hash = repo.refs[f'{remote_name}/{branch_name}'].object.hexsha

6
prestartup_script.py

@ -32,6 +32,8 @@ startup_script_path = os.path.join(comfyui_manager_path, "startup-scripts")
restore_snapshot_path = os.path.join(startup_script_path, "restore-snapshot.json")
git_script_path = os.path.join(comfyui_manager_path, "git_helper.py")
std_log_lock = threading.Lock()
class TerminalHook:
def __init__(self):
@ -184,6 +186,7 @@ try:
log_file.write(message)
log_file.flush()
with std_log_lock:
if self.is_stdout:
original_stdout.write(message)
original_stdout.flush()
@ -195,6 +198,8 @@ try:
def flush(self):
log_file.flush()
with std_log_lock:
if self.is_stdout:
original_stdout.flush()
else:
@ -202,7 +207,6 @@ try:
def close(self):
self.flush()
pass
def reconfigure(self, *args, **kwargs):
pass

Loading…
Cancel
Save