Get the effective dev command for a project. Returns the custom command if one is configured, otherwise returns the auto-detected default command. Args: project_dir: Path to the project directory. Returns: The effective dev command (custom if set, else detecte
(project_dir: Path)
| 332 | |
| 333 | |
| 334 | def get_dev_command(project_dir: Path) -> str | None: |
| 335 | """ |
| 336 | Get the effective dev command for a project. |
| 337 | |
| 338 | Returns the custom command if one is configured, |
| 339 | otherwise returns the auto-detected default command. |
| 340 | |
| 341 | Args: |
| 342 | project_dir: Path to the project directory. |
| 343 | |
| 344 | Returns: |
| 345 | The effective dev command (custom if set, else detected), |
| 346 | or None if neither is available. |
| 347 | """ |
| 348 | project_dir = Path(project_dir).resolve() |
| 349 | |
| 350 | # Check for custom command first |
| 351 | config = _load_config(project_dir) |
| 352 | custom_command = config.get("dev_command") |
| 353 | |
| 354 | if custom_command and isinstance(custom_command, str): |
| 355 | # Type is narrowed to str by isinstance check |
| 356 | result: str = custom_command |
| 357 | return result |
| 358 | |
| 359 | # Fall back to auto-detected command |
| 360 | return get_default_dev_command(project_dir) |
| 361 | |
| 362 | |
| 363 | def set_dev_command(project_dir: Path, command: str) -> None: |
no test coverage detected