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

Function ensure_autoforge_dir

autoforge_paths.py:99–111  ·  view source on GitHub ↗

Create the ``.autoforge/`` directory (if needed) and write its ``.gitignore``. Returns: The path to the ``.autoforge`` directory.

(project_dir: Path)

Source from the content-addressed store, hash-verified

97
98
99def ensure_autoforge_dir(project_dir: Path) -> Path:
100 """Create the ``.autoforge/`` directory (if needed) and write its ``.gitignore``.
101
102 Returns:
103 The path to the ``.autoforge`` directory.
104 """
105 autoforge_dir = get_autoforge_dir(project_dir)
106 autoforge_dir.mkdir(parents=True, exist_ok=True)
107
108 gitignore_path = autoforge_dir / ".gitignore"
109 gitignore_path.write_text(_GITIGNORE_CONTENT, encoding="utf-8")
110
111 return autoforge_dir
112
113
114# ---------------------------------------------------------------------------

Callers 2

scaffold_project_promptsFunction · 0.90
migrate_project_layoutFunction · 0.85

Calls 1

get_autoforge_dirFunction · 0.85

Tested by

no test coverage detected