MCPcopy Create free account
hub / github.com/AutoForgeAI/autoforge / get_project_dir

Function get_project_dir

server/routers/devserver.py:46–74  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

44
45
46def 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
76ALLOWED_RUNNERS = {
77 "npm", "pnpm", "yarn", "npx",

Callers 4

start_devserverFunction · 0.85
get_devserver_configFunction · 0.85
update_devserver_configFunction · 0.85

Calls 1

validate_project_nameFunction · 0.70

Tested by

no test coverage detected