From 139a6da67c4c13fed41cadbd53b82c0e2ad57083 Mon Sep 17 00:00:00 2001 From: Teknium Date: Sat, 18 Apr 2026 14:44:40 -0700 Subject: [PATCH] =?UTF-8?q?fix(skills):=20touchdesigner-mcp=20setup.sh=20?= =?UTF-8?q?=E2=80=94=20correct=20pgrep=20match=20+=20suppress=20stray=20ya?= =?UTF-8?q?ml=20output?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Discovered while dogfooding the skill end-to-end: - pgrep -if "TouchDesigner" matched any shell whose command line contained the substring (including the setup script's own invocation under certain wrappers), falsely reporting TD running on machines where it isn't. Switch to pgrep -x (exact process name match, supported on both macOS and Linux) and also check TouchDesignerFTE (the non-commercial variant). - The embedded python3 yaml-writer printed 'added' / 'exists' to stdout as status, which leaked a stray word into the setup output right before the ✔ line. Drop the print()s — the bash-level ✔/✘ is the status indicator. --- .../creative/touchdesigner-mcp/scripts/setup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/optional-skills/creative/touchdesigner-mcp/scripts/setup.sh b/optional-skills/creative/touchdesigner-mcp/scripts/setup.sh index 34d883c1c..15dc662c1 100644 --- a/optional-skills/creative/touchdesigner-mcp/scripts/setup.sh +++ b/optional-skills/creative/touchdesigner-mcp/scripts/setup.sh @@ -18,7 +18,10 @@ manual_steps=() echo -e "\n${CYAN}═══ twozero MCP for TouchDesigner — Setup ═══${NC}\n" # ── 1. Check if TouchDesigner is running ── -if pgrep -if "TouchDesigner" >/dev/null 2>&1; then +# Match on process *name* (not full cmdline) to avoid self-matching shells +# that happen to have "TouchDesigner" in their args. macOS and Linux pgrep +# both support -x for exact name match. +if pgrep -x TouchDesigner >/dev/null 2>&1 || pgrep -x TouchDesignerFTE >/dev/null 2>&1; then echo -e " ${OK} TouchDesigner is running" td_running=true else @@ -66,9 +69,6 @@ if 'twozero_td' not in cfg['mcp_servers']: } with open(cfg_path, 'w') as f: yaml.dump(cfg, f, default_flow_style=False, sort_keys=False) - print('added') -else: - print('exists') " 2>/dev/null && echo -e " ${OK} twozero_td MCP entry added to config" \ || { echo -e " ${FAIL} Could not update config (is PyYAML installed?)"; \ manual_steps+=("Add twozero_td MCP entry to ${HERMES_CFG} manually"); }