* 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)
| 326 | * nothing pointing at the env var. Mirrors validateLocalAgentServerPath. |
| 327 | */ |
| 328 | function 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. |
no outgoing calls
no test coverage detected