Skip to content

Commit

Permalink
Merge pull request #89 from Ryan526/main
Browse files Browse the repository at this point in the history
Fix: Ensure Directory Exists Before File Write Operation in db.py
  • Loading branch information
AntonOsika authored Jun 17, 2023
2 parents 28cb9df + 1d0a3ff commit 64f29b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gpt_engineer/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def __getitem__(self, key):
return f.read()

def __setitem__(self, key, val):
os.makedirs(self.path, exist_ok=True)

with open(self.path / key, 'w', encoding='utf-8') as f:
f.write(val)

Expand Down

0 comments on commit 64f29b2

Please sign in to comment.