mirror of
https://github.com/Comfy-Org/ComfyUI-Manager.git
synced 2025-12-16 18:02:58 +08:00
fix: cm-cli.py - enable/disable didn't working properly
This commit is contained in:
parent
655b3f6e32
commit
3dc00dc041
22
cm-cli.py
22
cm-cli.py
@ -390,14 +390,11 @@ def enable_node(node_name, is_all=False, cnt_msg=''):
|
|||||||
|
|
||||||
node_path, node_item = lookup_node_path(node_name, robust=True)
|
node_path, node_item = lookup_node_path(node_name, robust=True)
|
||||||
|
|
||||||
files = node_item['files'] if node_item is not None else [node_path]
|
if os.path.exists(node_path+'.disabled'):
|
||||||
|
current_name = node_path+'.disabled'
|
||||||
for x in files:
|
os.rename(current_name, node_path)
|
||||||
if os.path.exists(x+'.disabled'):
|
|
||||||
current_name = x+'.disabled'
|
|
||||||
os.rename(current_name, x)
|
|
||||||
print(f"{cnt_msg} [ENABLED] {node_name:50}")
|
print(f"{cnt_msg} [ENABLED] {node_name:50}")
|
||||||
elif os.path.exists(x):
|
elif os.path.exists(node_path):
|
||||||
print(f"{cnt_msg} [SKIPPED] {node_name:50} => Already enabled")
|
print(f"{cnt_msg} [SKIPPED] {node_name:50} => Already enabled")
|
||||||
elif not is_all:
|
elif not is_all:
|
||||||
print(f"{cnt_msg} [SKIPPED] {node_name:50} => Not installed")
|
print(f"{cnt_msg} [SKIPPED] {node_name:50} => Not installed")
|
||||||
@ -409,15 +406,12 @@ def disable_node(node_name, is_all=False, cnt_msg=''):
|
|||||||
|
|
||||||
node_path, node_item = lookup_node_path(node_name, robust=True)
|
node_path, node_item = lookup_node_path(node_name, robust=True)
|
||||||
|
|
||||||
files = node_item['files'] if node_item is not None else [node_path]
|
if os.path.exists(node_path):
|
||||||
|
current_name = node_path
|
||||||
for x in files:
|
new_name = node_path+'.disabled'
|
||||||
if os.path.exists(x):
|
|
||||||
current_name = x
|
|
||||||
new_name = x+'.disabled'
|
|
||||||
os.rename(current_name, new_name)
|
os.rename(current_name, new_name)
|
||||||
print(f"{cnt_msg} [DISABLED] {node_name:50}")
|
print(f"{cnt_msg} [DISABLED] {node_name:50}")
|
||||||
elif os.path.exists(x+'.disabled'):
|
elif os.path.exists(node_path+'.disabled'):
|
||||||
print(f"{cnt_msg} [ SKIPPED] {node_name:50} => Already disabled")
|
print(f"{cnt_msg} [ SKIPPED] {node_name:50} => Already disabled")
|
||||||
elif not is_all:
|
elif not is_all:
|
||||||
print(f"{cnt_msg} [ SKIPPED] {node_name:50} => Not installed")
|
print(f"{cnt_msg} [ SKIPPED] {node_name:50} => Not installed")
|
||||||
|
|||||||
@ -22,7 +22,7 @@ sys.path.append(glob_path)
|
|||||||
import cm_global
|
import cm_global
|
||||||
from manager_util import *
|
from manager_util import *
|
||||||
|
|
||||||
version = [2, 27]
|
version = [2, 27, 1]
|
||||||
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
version_str = f"V{version[0]}.{version[1]}" + (f'.{version[2]}' if len(version) > 2 else '')
|
||||||
|
|
||||||
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
comfyui_manager_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user