From 07d654ce1cd1640d4dca31bd5c8e2d700095ab35 Mon Sep 17 00:00:00 2001 From: CovenEsme <84377742+CovenEsme@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:53:44 +0100 Subject: [PATCH] Ensure the correct dir structure exists when running the rando --- sshdrando.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/sshdrando.py b/sshdrando.py index 5ccfa6c1..21dc03e9 100644 --- a/sshdrando.py +++ b/sshdrando.py @@ -7,6 +7,7 @@ # for more info. mp.freeze_support() +from filepathconstants import PLANDO_PATH, PRESETS_PATH, SSHD_EXTRACT_PATH from util.arguments import get_program_args import logging @@ -23,6 +24,16 @@ filemode="w", ) +# Ensure the necessary directories are created +if not SSHD_EXTRACT_PATH.exists(): + SSHD_EXTRACT_PATH.mkdir() + +if not PLANDO_PATH.exists(): + PLANDO_PATH.mkdir() + +if not PRESETS_PATH.exists(): + PRESETS_PATH.mkdir() + # Imports here to prevent circular dependency if not args.nogui: from gui.main import start_gui