mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 12:15:10 +00:00
Add directory creation to CreateFileTool
This commit is contained in:
1 parent
8fbf9cec5c
commit
6927559e93
1 file changed
+1
@@ -245,6 +245,7 @@ class CreateFileTool(Tool):
|
||||
:return: a message indicating success or failure
|
||||
"""
|
||||
absolute_path = os.path.join(self.project_root, relative_path)
|
||||
os.makedirs(os.path.dirname(absolute_path), exist_ok=True)
|
||||
with open(absolute_path, "w", encoding="utf-8") as f:
|
||||
f.write(content)
|
||||
return f"File created: {relative_path}"
|
||||
|
||||
Reference in new issue
Block a user