Save a custom dev command for a project. Args: project_dir: Path to the project directory. command: The custom dev command to save. Raises: ValueError: If command is empty or not a string, or if project_dir is invalid. OSError: If the config file cannot
(project_dir: Path, command: str)
| 361 | |
| 362 | |
| 363 | def set_dev_command(project_dir: Path, command: str) -> None: |
| 364 | """ |
| 365 | Save a custom dev command for a project. |
| 366 | |
| 367 | Args: |
| 368 | project_dir: Path to the project directory. |
| 369 | command: The custom dev command to save. |
| 370 | |
| 371 | Raises: |
| 372 | ValueError: If command is empty or not a string, or if project_dir is invalid. |
| 373 | OSError: If the config file cannot be written. |
| 374 | """ |
| 375 | if not command or not isinstance(command, str): |
| 376 | raise ValueError("Command must be a non-empty string") |
| 377 | |
| 378 | project_dir = _validate_project_dir(project_dir) |
| 379 | |
| 380 | # Load existing config and update |
| 381 | config = _load_config(project_dir) |
| 382 | config["dev_command"] = command |
| 383 | |
| 384 | _save_config(project_dir, config) |
| 385 | logger.info("Set custom dev command for %s: %s", project_dir.name, command) |
| 386 | |
| 387 | |
| 388 | def clear_dev_command(project_dir: Path) -> None: |
no test coverage detected