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

Function set_dev_command

server/services/project_config.py:363–385  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

361
362
363def 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
388def clear_dev_command(project_dir: Path) -> None:

Callers 1

update_devserver_configFunction · 0.85

Calls 3

_validate_project_dirFunction · 0.85
_load_configFunction · 0.85
_save_configFunction · 0.85

Tested by

no test coverage detected