Skip to content

Commit

Permalink
Supports folder creation
Browse files Browse the repository at this point in the history
  • Loading branch information
saten-private committed May 17, 2024
1 parent efb7833 commit 5841df3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions babyagi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,8 @@ def write_file(file_path: str, content: str):
os.makedirs(os.path.dirname(file_path), exist_ok=True)
with open(file_path, "w") as file:
file.write(content)
except IsADirectoryError:
return
except Exception as e:
raise e

Expand Down

0 comments on commit 5841df3

Please sign in to comment.