From 208ca318365f3fb15886082a2bdfce108ddf0e35 Mon Sep 17 00:00:00 2001 From: "Dr.Lt.Data" Date: Wed, 19 Mar 2025 07:41:39 +0900 Subject: [PATCH] support installation of system added nodepack modified: install_by_id - Change the install path of the CNR node added by the system to be based on the repo URL instead of the CNR ID. --- glob/manager_core.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/glob/manager_core.py b/glob/manager_core.py index e9af16bc..22cf81e6 100644 --- a/glob/manager_core.py +++ b/glob/manager_core.py @@ -1442,12 +1442,20 @@ class UnifiedManager: return self.unified_enable(node_id, version_spec) elif version_spec == 'unknown' or version_spec == 'nightly': + to_path = os.path.abspath(os.path.join(get_default_custom_nodes_path(), node_id)) + if version_spec == 'nightly': # disable cnr nodes if self.is_enabled(node_id, 'cnr'): self.unified_disable(node_id, False) - to_path = os.path.abspath(os.path.join(get_default_custom_nodes_path(), node_id)) + # use `repo name` as a dir name instead of `cnr id` if system added nodepack (i.e. publisher is null) + cnr = self.cnr_map.get(node_id) + + if cnr is not None and cnr.get('publisher') is None: + repo_name = os.path.basename(git_utils.normalize_url(repo_url)) + to_path = os.path.abspath(os.path.join(get_default_custom_nodes_path(), repo_name)) + res = self.repo_install(repo_url, to_path, instant_execution=instant_execution, no_deps=no_deps, return_postinstall=return_postinstall) if res.result: if version_spec == 'unknown':