mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
feat: merge geekan:cli-etc
This commit is contained in:
parent
6e0fc04225
commit
4928a896ca
1 changed files with 3 additions and 0 deletions
|
|
@ -7,6 +7,7 @@
|
|||
@Desc: PrepareDocuments Action: initialize project folder and add new requirements to docs/requirements.txt.
|
||||
RFC 135 2.2.3.5.1.
|
||||
"""
|
||||
import shutil
|
||||
|
||||
from metagpt.actions import Action, ActionOutput
|
||||
from metagpt.config import CONFIG
|
||||
|
|
@ -28,6 +29,8 @@ class PrepareDocuments(Action):
|
|||
# Create and initialize the workspace folder, initialize the Git environment.
|
||||
project_name = CONFIG.project_name or FileRepository.new_filename()
|
||||
workdir = CONFIG.project_path or DEFAULT_WORKSPACE_ROOT / project_name
|
||||
if not CONFIG.inc and workdir.exists():
|
||||
shutil.rmtree(workdir)
|
||||
CONFIG.git_repo = GitRepository()
|
||||
CONFIG.git_repo.open(local_path=workdir, auto_init=True)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue