MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / runProcess

Function runProcess

src/index.js:551–562  ·  view source on GitHub ↗
(command, args, cwd, timeoutMs = 60_000)

Source from the content-addressed store, hash-verified

549 if (args === undefined || args === null) return ""
550 if (typeof args === "string") return args.trim().replace(/\s+/g, " ")
551 if (Array.isArray(args)) return args.map(normalizeArgsForKey).join(" ").trim().replace(/\s+/g, " ")
552 try { return JSON.stringify(args) } catch { return String(args) }
553}
554
555function commandArgsText(args) {
556 if (args === undefined || args === null) return ""
557 if (typeof args === "string") return args
558 if (Array.isArray(args)) return args.map(commandArgsText).join(" ")
559 if (typeof args === "object") {
560 for (const key of ["arguments", "args", "message", "text", "value"]) {
561 if (args[key] !== undefined) return commandArgsText(args[key])
562 }
563 }
564 return String(args)
565}

Callers 2

ensureBranchFunction · 0.85
createCheckpointFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected