From 764c9f2a8103549cf90db59aac6cb16bbde860a6 Mon Sep 17 00:00:00 2001 From: Bret Mogilefsky Date: Mon, 2 Nov 2026 22:50:05 -0800 Subject: [PATCH] fix(first-mate): exec .cmd/.bat via shell on Windows --- .../skills/paseo-first-mate/assets/first-mate-check.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/first-mate-skill/files/home/.agents/skills/paseo-first-mate/assets/first-mate-check.py b/first-mate-skill/files/home/.agents/skills/paseo-first-mate/assets/first-mate-check.py index 4010667..437afc3 100755 --- a/first-mate-skill/files/home/.agents/skills/paseo-first-mate/assets/first-mate-check.py +++ b/first-mate-skill/files/home/.agents/skills/paseo-first-mate/assets/first-mate-check.py @@ -36,6 +36,7 @@ import json import os import re +import shutil import subprocess import sys @@ -123,7 +124,12 @@ def short(w, repo): def run(cmd): - out = subprocess.run(cmd, capture_output=True, text=True, timeout=TIMEOUT) + exe = shutil.which(cmd[0]) + if sys.platform == "win32" and exe and exe.lower().endswith((".cmd", ".bat")): + # Windows cannot exec a .cmd/.bat directly; route it through cmd.exe. + out = subprocess.run(subprocess.list2cmdline(cmd), capture_output=True, text=True, timeout=TIMEOUT, shell=True) + else: + out = subprocess.run(cmd, capture_output=True, text=True, timeout=TIMEOUT) if out.returncode != 0: raise RuntimeError((out.stderr or out.stdout).strip().splitlines()[-1][:160]) return out.stdout