mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 09:46:24 +02:00
feat: merge geekan:cli-etc
This commit is contained in:
parent
7b44fccf8d
commit
94043a89f4
3 changed files with 14 additions and 17 deletions
|
|
@ -54,7 +54,7 @@ class FileRepository:
|
|||
"""
|
||||
pathname = self.workdir / filename
|
||||
pathname.parent.mkdir(parents=True, exist_ok=True)
|
||||
async with aiofiles.open(str(pathname), mode="wb") as writer:
|
||||
async with aiofiles.open(str(pathname), mode="w") as writer:
|
||||
await writer.write(content)
|
||||
logger.info(f"save to: {str(pathname)}")
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ class FileRepository:
|
|||
if not path_name.exists():
|
||||
return None
|
||||
try:
|
||||
async with aiofiles.open(str(path_name), mode="rb") as reader:
|
||||
async with aiofiles.open(str(path_name), mode="r") as reader:
|
||||
doc.content = await reader.read()
|
||||
except FileNotFoundError as e:
|
||||
logger.info(f"open {str(path_name)} failed:{e}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue