fix: Windows PATH detection for CLI tools in PowerShell environments

- Add shell=True parameter to subprocess.run() calls on Windows platform
- Fixes issue #128 where Claude CLI, Node.js, and npm were not detected in PowerShell
- Affects validator.py and mcp.py components for better Windows compatibility
- Resolves PowerShell PATH inheritance issues with Python subprocess

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
NomenAK
2025-07-14 21:11:28 +02:00
parent f975070946
commit b9fac065e0
2 changed files with 27 additions and 14 deletions

View File

@@ -114,12 +114,13 @@ class Validator:
return self.validation_cache[cache_key]
try:
# Check if node is installed
# Check if node is installed - use shell=True on Windows for better PATH resolution
result = subprocess.run(
['node', '--version'],
capture_output=True,
text=True,
timeout=10
timeout=10,
shell=(sys.platform == "win32")
)
if result.returncode != 0:
@@ -181,12 +182,13 @@ class Validator:
return self.validation_cache[cache_key]
try:
# Check if claude is installed
# Check if claude is installed - use shell=True on Windows for better PATH resolution
result = subprocess.run(
['claude', '--version'],
capture_output=True,
text=True,
timeout=10
timeout=10,
shell=(sys.platform == "win32")
)
if result.returncode != 0:
@@ -254,7 +256,8 @@ class Validator:
cmd_parts,
capture_output=True,
text=True,
timeout=10
timeout=10,
shell=(sys.platform == "win32")
)
if result.returncode != 0:
@@ -651,7 +654,8 @@ class Validator:
["which" if sys.platform != "win32" else "where", tool],
capture_output=True,
text=True,
timeout=5
timeout=5,
shell=(sys.platform == "win32")
)
if result.returncode == 0:
tool_found = True