Skip to content

Commit

Permalink
don't fail silently (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata authored May 15, 2024
1 parent 708e4b4 commit b560d84
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions comfy_cli/command/custom_nodes/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,32 +408,29 @@ def uninstall(


def update_node_id_cache():
try:
config_manager = ConfigManager()
workspace_path = workspace_manager.workspace_path
config_manager = ConfigManager()
workspace_path = workspace_manager.workspace_path

cm_cli_path = os.path.join(
workspace_path, "custom_nodes", "ComfyUI-Manager", "cm-cli.py"
)
cm_cli_path = os.path.join(
workspace_path, "custom_nodes", "ComfyUI-Manager", "cm-cli.py"
)

tmp_path = os.path.join(config_manager.get_config_path(), "tmp")
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)
tmp_path = os.path.join(config_manager.get_config_path(), "tmp")
if not os.path.exists(tmp_path):
os.makedirs(tmp_path)

cache_path = os.path.join(tmp_path, "node-cache.list")
cmd = [sys.executable, cm_cli_path, "export-custom-node-ids", cache_path]

new_env = os.environ.copy()
new_env["COMFYUI_PATH"] = workspace_path
res = subprocess.run(cmd, env=new_env, check=True)
if res.returncode != 0:
typer.echo(
"Failed to update node id cache.",
err=True,
)
raise typer.Exit(code=1)
except Exception:
pass
cache_path = os.path.join(tmp_path, "node-cache.list")
cmd = [sys.executable, cm_cli_path, "export-custom-node-ids", cache_path]

new_env = os.environ.copy()
new_env["COMFYUI_PATH"] = workspace_path
res = subprocess.run(cmd, env=new_env, check=True)
if res.returncode != 0:
typer.echo(
"Failed to update node id cache.",
err=True,
)
raise typer.Exit(code=1)


# `update, disable, enable, fix` allows `all` param
Expand Down

0 comments on commit b560d84

Please sign in to comment.