From ffe2c5de0ee53b8afed8f80d7462fd3b4fc16090 Mon Sep 17 00:00:00 2001 From: xXUnique31Xx Date: Mon, 1 Jul 2024 19:12:35 +0200 Subject: [PATCH] add create_dir_if_not_exists --- controller.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/controller.py b/controller.py index 7386624..2ccf1a4 100644 --- a/controller.py +++ b/controller.py @@ -248,4 +248,11 @@ def load_gamestate(self): return False self.view.last_board = self.board.get_copy_board_state() - return True \ No newline at end of file + return True + + @staticmethod + def create_directory_if_not_exists(): + """ + Create the directory for saved games if it does not exist. + """ + Path("savedGames").mkdir(parents=True, exist_ok=True) \ No newline at end of file