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

Function spawnProcess

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

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.70

Calls 7

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

Tested by

no test coverage detected