MCPcopy
hub / github.com/Comfy-Org/ComfyUI-Manager / repo_install

Method repo_install

comfyui_manager/glob/manager_core.py:1336–1376  ·  view source on GitHub ↗
(self, url: str, repo_path: str, instant_execution=False, no_deps=False, return_postinstall=False)

Source from the content-addressed store, hash-verified

1334 return result
1335
1336 def repo_install(self, url: str, repo_path: str, instant_execution=False, no_deps=False, return_postinstall=False):
1337 result = ManagedResult('install-git')
1338 result.append(url)
1339
1340 if 'comfyui-manager' in url.lower():
1341 return result.fail(f"ignored: installing '{url}'")
1342
1343 if not is_valid_url(url):
1344 return result.fail(f"Invalid git url: {url}")
1345
1346 if url.endswith("/"):
1347 url = url[:-1]
1348 try:
1349 # Clone the repository from the remote URL
1350 clone_url = git_utils.get_url_for_clone(url)
1351 print(f"Download: git clone '{clone_url}'")
1352
1353 if not instant_execution and platform.system() == 'Windows':
1354 res = manager_funcs.run_script([sys.executable, context.git_script_path, "--clone", get_default_custom_nodes_path(), clone_url, repo_path], cwd=get_default_custom_nodes_path())
1355 if res != 0:
1356 return result.fail(f"Failed to clone repo: {clone_url}")
1357 else:
1358 repo = clone_repo(clone_url, repo_path, progress=GitProgress())
1359 repo.clear_cache()
1360 repo.close()
1361
1362 def postinstall():
1363 return self.execute_install_script(url, repo_path, instant_execution=instant_execution, no_deps=no_deps)
1364
1365 if return_postinstall:
1366 return result.with_postinstall(postinstall)
1367 else:
1368 if not postinstall():
1369 return result.fail(f"Failed to execute install script: {url}")
1370
1371 except Exception as e:
1372 traceback.print_exc()
1373 return result.fail(f"Install(git-clone) error[2]: {url} / {e}")
1374
1375 print("Installation was successful.")
1376 return result
1377
1378 def repo_update(self, repo_path, instant_execution=False, no_deps=False, return_postinstall=False):
1379 result = ManagedResult('update-git')

Callers 2

install_by_idMethod · 0.95
restore_snapshotFunction · 0.45

Calls 11

appendMethod · 0.95
failMethod · 0.95
with_postinstallMethod · 0.95
clone_repoFunction · 0.85
ManagedResultClass · 0.70
is_valid_urlFunction · 0.70
GitProgressClass · 0.70
run_scriptMethod · 0.45
clear_cacheMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected