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

Function validateLocalAutomationPath

scripts/dev-with-automation.mjs:328–343  ·  view source on GitHub ↗

* Fail fast on an unusable OH_AUTOMATION_LOCAL_PATH instead of letting * `uv run --project ` exit on its own -- that leaves the rest of the * stack up and the automations UI just reporting "backend unavailable", with * nothing pointing at the env var. Mirrors validateLocalAgentServerPat

(localPath)

Source from the content-addressed store, hash-verified

326 * nothing pointing at the env var. Mirrors validateLocalAgentServerPath.
327 */
328function validateLocalAutomationPath(localPath) {
329 if (!isAbsolute(localPath)) {
330 throw new Error(
331 `OH_AUTOMATION_LOCAL_PATH must be an absolute path, got: ${localPath}`,
332 );
333 }
334 if (!existsSync(localPath)) {
335 throw new Error(`OH_AUTOMATION_LOCAL_PATH does not exist: ${localPath}`);
336 }
337 const projectFile = join(localPath, "pyproject.toml");
338 if (!existsSync(projectFile)) {
339 throw new Error(
340 `OH_AUTOMATION_LOCAL_PATH is not a Python project (no pyproject.toml): ${projectFile}`,
341 );
342 }
343}
344
345/**
346 * Build the uvx command for running automation backend.

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected