Enable use of shell also for Windows in execute_shell_command

This is really required, as many commands must be interpreted by the shell
(e.g. execution of batch files/other executables without specifying the extension, etc.)

For example, npm typically cannot just be run as npm otherwise
This commit is contained in:
Dominik Jain authored and Dominik Jain committed 2025-09-10 14:23:24 +02:00
1 parent 7144154fe5
commit da9da7936c
1 file changed
+1 -3
+1 -3
View File
@@ -1,5 +1,4 @@
import os
import platform
import subprocess
from pydantic import BaseModel
@@ -26,10 +25,9 @@ def execute_shell_command(command: str, cwd: str | None = None, capture_stderr:
if cwd is None:
cwd = os.getcwd()
is_windows = platform.system() == "Windows"
process = subprocess.Popen(
command,
shell=not is_windows,
shell=True,
stdin=subprocess.DEVNULL,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE if capture_stderr else None,