mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-17 12:45:26 +01:00
Update db.py
Ensure directory exists before attempting to write file in db.py
This commit is contained in:
@@ -15,6 +15,9 @@ class DB:
|
||||
return f.read()
|
||||
|
||||
def __setitem__(self, key, val):
|
||||
# Ensure the directory exists
|
||||
os.makedirs(self.path, exist_ok=True)
|
||||
|
||||
with open(self.path / key, 'w', encoding='utf-8') as f:
|
||||
f.write(val)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user