mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 02:14:49 +00:00
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:
1 parent
7144154fe5
commit
da9da7936c
1 file changed
+1
-3
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user