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

Function spawnProcess

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

Source from the content-addressed store, hash-verified

1154}
1155
1156function spawnProcess(command, args, options = {}) {
1157 const child = spawn(
1158 command,
1159 args,
1160 getProcessTreeSpawnOptions({
1161 stdio: "inherit",
1162 ...options,
1163 }),
1164 );
1165
1166 child.once("error", (error) => {
1167 if (isEnoentError(error) && command === "uvx") {
1168 const msg = formatMissingUvxGuidance(options?.cwd);
1169 console.error(msg);
1170 fileLog("error", stripAnsi(msg));
1171 } else if (isEnoentError(error)) {
1172 const msg = `Failed to start ${command}. Make sure it is installed and on your PATH.`;
1173 console.error(msg);
1174 fileLog("error", msg);
1175 } else {
1176 console.error(`Failed to start ${command}:`, error);
1177 fileLog("error", `Failed to start ${command}: ${error.message}`);
1178 }
1179 });
1180
1181 return child;
1182}
1183
1184async function main() {
1185 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