MCPcopy
hub / github.com/RedPlanetHQ/core / runShellCommand

Function runShellCommand

packages/cli/src/utils/browser-config.ts:315–341  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

313}
314
315function runShellCommand(command: string): Promise<CommandResult> {
316 return new Promise(resolve => {
317 const proc = spawn(command, [], {
318 stdio: ['pipe', 'pipe', 'pipe'],
319 shell: true,
320 });
321
322 let stdout = '';
323 let stderr = '';
324
325 proc.stdout?.on('data', (data: Buffer) => {
326 stdout += data.toString();
327 });
328
329 proc.stderr?.on('data', (data: Buffer) => {
330 stderr += data.toString();
331 });
332
333 proc.on('close', (code: number | null) => {
334 resolve({stdout, stderr, code: code ?? 0});
335 });
336
337 proc.on('error', (err: Error) => {
338 resolve({stdout, stderr: err.message, code: 1});
339 });
340 });
341}
342
343export async function isPlaywrightReady(): Promise<boolean> {
344 try {

Callers 2

getPlaywrightVersionFunction · 0.85

Calls 3

onMethod · 0.80
toStringMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected