Skip to content

Commit

Permalink
comfy node command
Browse files Browse the repository at this point in the history
improve: non verbose error message for normal error
fix: remove useless path arg from `clear` command
  • Loading branch information
ltdrdata committed May 15, 2024
1 parent cd94446 commit 74b7405
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions comfy_cli/command/custom_nodes/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ def execute_cm_cli(args, channel=None, mode=None):

print(f"Execute from: {workspace_path}")

res = subprocess.run(cmd, env=new_env, check=True)
if res.returncode != 0:
print(f"Failed to execute: {cmd}", file=sys.stderr)
raise typer.Exit(code=1)
try:
subprocess.run(cmd, env=new_env, check=True)
except subprocess.CalledProcessError as e:
if e.returncode == 1:
print(f"Execution error: {cmd}", file=sys.stderr)
elif e.returncode == 2:
pass
else:
raise e

workspace_manager.set_recent_workspace(workspace_path)


Expand Down Expand Up @@ -166,9 +172,8 @@ def enable_gui():

@manager_app.command(help="Clear reserved startup action in ComfyUI-Manager")
@tracking.track_command("node")
def clear(path: str):
path = os.path.abspath(path)
execute_cm_cli(["clear", path])
def clear():
execute_cm_cli(["clear"])


# completers
Expand Down Expand Up @@ -632,6 +637,9 @@ def deps_in_workflow(
):
validate_mode(mode)

workflow = os.path.abspath(os.path.expanduser(workflow))
output = os.path.abspath(os.path.expanduser(output))

execute_cm_cli(
["deps-in-workflow", "--workflow", workflow, "--output", output],
channel,
Expand Down

0 comments on commit 74b7405

Please sign in to comment.