mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-29 15:59:42 +02:00
1. Added test_increment.py
2. Modify prompt in design_api_an.py 3. Modify rename_root function using method of copy in git_repository.py
This commit is contained in:
parent
4a498a9068
commit
994cfe814b
3 changed files with 168 additions and 5 deletions
|
|
@ -138,7 +138,7 @@ Based on new requirements, review and refine the system design. Integrate existi
|
|||
NODES = [
|
||||
IMPLEMENTATION_APPROACH,
|
||||
# PROJECT_NAME,
|
||||
REFINED_FILE_LIST,
|
||||
FILE_LIST,
|
||||
DATA_STRUCTURES_AND_INTERFACES,
|
||||
PROGRAM_CALL_FLOW,
|
||||
ANYTHING_UNCLEAR,
|
||||
|
|
|
|||
|
|
@ -190,7 +190,7 @@ class GitRepository:
|
|||
return self._dependency
|
||||
|
||||
def rename_root(self, new_dir_name):
|
||||
"""Rename the root directory of the Git repository.
|
||||
"""Rename/Copy the root directory of the Git repository.
|
||||
|
||||
:param new_dir_name: The new name for the root directory.
|
||||
"""
|
||||
|
|
@ -201,10 +201,15 @@ class GitRepository:
|
|||
logger.info(f"Delete directory {str(new_path)}")
|
||||
shutil.rmtree(new_path)
|
||||
try:
|
||||
shutil.move(src=str(self.workdir), dst=str(new_path))
|
||||
shutil.copytree(src=str(self.workdir), dst=str(new_path))
|
||||
except Exception as e:
|
||||
logger.warning(f"Move {str(self.workdir)} to {str(new_path)} error: {e}")
|
||||
logger.info(f"Rename directory {str(self.workdir)} to {str(new_path)}")
|
||||
logger.warning(f"Copy {str(self.workdir)} to {str(new_path)} error: {e}")
|
||||
logger.info(f"Copy directory {str(self.workdir)} to {str(new_path)}")
|
||||
# try:
|
||||
# shutil.move(src=str(self.workdir), dst=str(new_path))
|
||||
# except Exception as e:
|
||||
# logger.warning(f"Move {str(self.workdir)} to {str(new_path)} error: {e}")
|
||||
# logger.info(f"Rename directory {str(self.workdir)} to {str(new_path)}")
|
||||
self._repository = Repo(new_path)
|
||||
self._gitignore_rules = parse_gitignore(full_path=str(new_path / ".gitignore"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue