mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 20:03:28 +02:00
fixbug: write to folder
This commit is contained in:
parent
654ed131d7
commit
fd080fa633
8 changed files with 16 additions and 11 deletions
|
|
@ -25,7 +25,7 @@ class Editor:
|
|||
self.resource = EditorReporter()
|
||||
|
||||
def write(self, path: str, content: str):
|
||||
"""Write the whole content to a file. When used, make sure content arg contains the full content of the file."""
|
||||
"""Write the whole content to a file. The path must be a file path with a specific file extension. When used, make sure content arg contains the full content of the file."""
|
||||
if "\n" not in content and "\\n" in content:
|
||||
# A very raw rule to correct the content: If 'content' lacks actual newlines ('\n') but includes '\\n', consider
|
||||
# replacing them with '\n' to potentially correct mistaken representations of newline characters.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue