MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / spawnProcess

Function spawnProcess

scripts/dev-safe.mjs:803–829  ·  view source on GitHub ↗
(command, args, options = {})

Source from the content-addressed store, hash-verified

801}
802
803function spawnProcess(command, args, options = {}) {
804 const child = spawn(
805 command,
806 args,
807 getProcessTreeSpawnOptions({
808 stdio: "inherit",
809 ...options,
810 }),
811 );
812
813 child.once("error", (error) => {
814 if (isEnoentError(error) && command === "uvx") {
815 const msg = formatMissingUvxGuidance(options?.cwd);
816 console.error(msg);
817 fileLog("error", stripAnsi(msg));
818 } else if (isEnoentError(error)) {
819 const msg = `Failed to start ${command}. Make sure it is installed and on your PATH.`;
820 console.error(msg);
821 fileLog("error", msg);
822 } else {
823 console.error(`Failed to start ${command}:`, error);
824 fileLog("error", `Failed to start ${command}: ${error.message}`);
825 }
826 });
827
828 return child;
829}
830
831async function main() {
832 console.log("Starting isolated agent-server + frontend dev stack...");

Callers 1

mainFunction · 0.70

Calls 6

fileLogFunction · 0.90
stripAnsiFunction · 0.90
formatMissingUvxGuidanceFunction · 0.85
errorMethod · 0.80
isEnoentErrorFunction · 0.70

Tested by

no test coverage detected