create the folder if it doesn't exist
This commit is contained in:
parent
65339b5435
commit
c888632fa7
2
.gitignore
vendored
2
.gitignore
vendored
@ -141,4 +141,4 @@ frontend/package-lock.json
|
|||||||
bang-workspace.code-workspace
|
bang-workspace.code-workspace
|
||||||
|
|
||||||
.vscode/
|
.vscode/
|
||||||
backend/games.pickle
|
backend/save/*
|
@ -813,6 +813,8 @@ def save_games():
|
|||||||
while True:
|
while True:
|
||||||
sio.sleep(2)
|
sio.sleep(2)
|
||||||
if not save_lock:
|
if not save_lock:
|
||||||
|
if not os.path.exists("save"):
|
||||||
|
os.mkdir("save")
|
||||||
with open('./save/games.pickle', 'wb') as f:
|
with open('./save/games.pickle', 'wb') as f:
|
||||||
pickle.dump([g for g in games if g.started and not g.is_replay and not g.is_hidden], f)
|
pickle.dump([g for g in games if g.started and not g.is_replay and not g.is_hidden], f)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user