MCPcopy Index your code
hub / github.com/openai/codex-plugin-cc / runCommand

Function runCommand

plugins/codex/scripts/lib/process.mjs:4–25  ·  view source on GitHub ↗
(command, args = [], options = {})

Source from the content-addressed store, hash-verified

2import process from "node:process";
3
4export function runCommand(command, args = [], options = {}) {
5 const result = spawnSync(command, args, {
6 cwd: options.cwd,
7 env: options.env,
8 encoding: "utf8",
9 input: options.input,
10 maxBuffer: options.maxBuffer,
11 stdio: options.stdio ?? "pipe",
12 shell: process.platform === "win32" ? (process.env.SHELL || true) : false,
13 windowsHide: true
14 });
15
16 return {
17 command,
18 args,
19 status: result.status ?? 0,
20 signal: result.signal ?? null,
21 stdout: result.stdout ?? "",
22 stderr: result.stderr ?? "",
23 error: result.error ?? null
24 };
25}
26
27export function runCommandChecked(command, args = [], options = {}) {
28 const result = runCommand(command, args, options);

Callers 3

gitFunction · 0.90
runCommandCheckedFunction · 0.85
binaryAvailableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected