MCPcopy Index your code
hub / github.com/microsoft/Webwright / _validate_bash_command

Function _validate_bash_command

src/webwright/models/base.py:123–136  ·  view source on GitHub ↗
(command: str)

Source from the content-addressed store, hash-verified

121
122
123def _validate_bash_command(command: str) -> None:
124 result = subprocess.run(
125 ["/bin/bash", "-n"],
126 input=command,
127 text=True,
128 capture_output=True,
129 encoding="utf-8",
130 errors="replace",
131 check=False,
132 )
133 if result.returncode == 0:
134 return
135 error = (result.stderr or result.stdout or "bash syntax check failed").strip()
136 raise ValueError(f"Invalid bash_command syntax: {error}")
137
138
139def text_part(text: str) -> dict[str, Any]:

Callers 1

_query_asyncMethod · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected