mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-12 09:12:38 +02:00
provide example for running the whole software company; fix editor bug
This commit is contained in:
parent
a59b9e2286
commit
8e2c7c964f
3 changed files with 56 additions and 10 deletions
|
|
@ -27,7 +27,7 @@ class Editor:
|
|||
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."""
|
||||
directory = os.path.dirname(path)
|
||||
if not os.path.exists(directory):
|
||||
if directory and not os.path.exists(directory):
|
||||
os.makedirs(directory)
|
||||
with open(path, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue