mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-17 02:12:58 +08:00
execute install script after update
This commit is contained in:
parent
93537f6333
commit
c4efab0d81
49
__init__.py
49
__init__.py
@ -339,21 +339,7 @@ def copy_set_active(files, is_disable, js_path_name=None):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def gitclone_install(files):
|
def execute_install_script(url, repo_path):
|
||||||
print(f"install: {files}")
|
|
||||||
for url in files:
|
|
||||||
try:
|
|
||||||
print(f"Download: git clone '{url}'")
|
|
||||||
clone_cmd = ["git", "clone", url]
|
|
||||||
code = subprocess.run(clone_cmd, cwd=custom_nodes_path)
|
|
||||||
|
|
||||||
if code.returncode != 0:
|
|
||||||
print(f"git-clone failed: {url}")
|
|
||||||
return False
|
|
||||||
|
|
||||||
repo_name = os.path.splitext(os.path.basename(url))[0]
|
|
||||||
repo_path = os.path.join(custom_nodes_path, repo_name)
|
|
||||||
|
|
||||||
install_script_path = os.path.join(repo_path, "install.py")
|
install_script_path = os.path.join(repo_path, "install.py")
|
||||||
requirements_path = os.path.join(repo_path, "requirements.txt")
|
requirements_path = os.path.join(repo_path, "requirements.txt")
|
||||||
|
|
||||||
@ -375,6 +361,26 @@ def gitclone_install(files):
|
|||||||
print(f"install script failed: {url}")
|
print(f"install script failed: {url}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
def gitclone_install(files):
|
||||||
|
print(f"install: {files}")
|
||||||
|
for url in files:
|
||||||
|
try:
|
||||||
|
print(f"Download: git clone '{url}'")
|
||||||
|
clone_cmd = ["git", "clone", url]
|
||||||
|
code = subprocess.run(clone_cmd, cwd=custom_nodes_path)
|
||||||
|
|
||||||
|
if code.returncode != 0:
|
||||||
|
print(f"git-clone failed: {url}")
|
||||||
|
return False
|
||||||
|
|
||||||
|
repo_name = os.path.splitext(os.path.basename(url))[0]
|
||||||
|
repo_path = os.path.join(custom_nodes_path, repo_name)
|
||||||
|
|
||||||
|
if not execute_install_script(url, repo_path):
|
||||||
|
return False
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Install(git-clone) error: {url} / {e}")
|
print(f"Install(git-clone) error: {url} / {e}")
|
||||||
return False
|
return False
|
||||||
@ -449,18 +455,21 @@ def gitclone_set_active(files, is_disable):
|
|||||||
def gitclone_update(files):
|
def gitclone_update(files):
|
||||||
import os
|
import os
|
||||||
|
|
||||||
print(f"uninstall: {files}")
|
print(f"update: {files}")
|
||||||
for url in files:
|
for url in files:
|
||||||
try:
|
try:
|
||||||
dir_name = os.path.splitext(os.path.basename(url))[0].replace(".git", "")
|
repo_name = os.path.splitext(os.path.basename(url))[0].replace(".git", "")
|
||||||
dir_path = os.path.join(custom_nodes_path, dir_name)
|
repo_path = os.path.join(custom_nodes_path, repo_name)
|
||||||
git_pull(dir_path)
|
git_pull(repo_path)
|
||||||
|
|
||||||
|
if not execute_install_script(url, repo_path):
|
||||||
|
return False
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Update(git-clone) error: {url} / {e}")
|
print(f"Update(git-clone) error: {url} / {e}")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
print("Uninstallation was successful.")
|
print("Update was successful.")
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user