Get the validated project directory for a project name. Args: project_name: Name of the project Returns: Path to the project directory Raises: HTTPException: If project is not found or directory does not exist
(project_name: str)
| 44 | |
| 45 | |
| 46 | def get_project_dir(project_name: str) -> Path: |
| 47 | """ |
| 48 | Get the validated project directory for a project name. |
| 49 | |
| 50 | Args: |
| 51 | project_name: Name of the project |
| 52 | |
| 53 | Returns: |
| 54 | Path to the project directory |
| 55 | |
| 56 | Raises: |
| 57 | HTTPException: If project is not found or directory does not exist |
| 58 | """ |
| 59 | project_name = validate_project_name(project_name) |
| 60 | project_dir = _get_project_path(project_name) |
| 61 | |
| 62 | if not project_dir: |
| 63 | raise HTTPException( |
| 64 | status_code=404, |
| 65 | detail=f"Project '{project_name}' not found in registry" |
| 66 | ) |
| 67 | |
| 68 | if not project_dir.exists(): |
| 69 | raise HTTPException( |
| 70 | status_code=404, |
| 71 | detail=f"Project directory not found: {project_dir}" |
| 72 | ) |
| 73 | |
| 74 | return project_dir |
| 75 | |
| 76 | ALLOWED_RUNNERS = { |
| 77 | "npm", "pnpm", "yarn", "npx", |
no test coverage detected