From acb85d7bb1ad7c1854a98de63e05cfc2473eae5d Mon Sep 17 00:00:00 2001 From: DominikDoom Date: Sun, 23 Jul 2023 09:01:26 +0200 Subject: [PATCH] Make sure both temp folders exist --- scripts/model_keyword_support.py | 2 -- scripts/shared_paths.py | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/model_keyword_support.py b/scripts/model_keyword_support.py index 017fa83..c3e197e 100644 --- a/scripts/model_keyword_support.py +++ b/scripts/model_keyword_support.py @@ -7,8 +7,6 @@ from scripts.shared_paths import EXT_PATH, STATIC_TEMP_PATH, TEMP_PATH # Set up our hash cache known_hashes_file = TEMP_PATH.joinpath("known_lora_hashes.txt") -if not TEMP_PATH.exists(): - TEMP_PATH.mkdir() known_hashes_file.touch() file_needs_update = False diff --git a/scripts/shared_paths.py b/scripts/shared_paths.py index 591df23..1ef7a53 100644 --- a/scripts/shared_paths.py +++ b/scripts/shared_paths.py @@ -44,4 +44,10 @@ WILDCARD_EXT_PATHS = find_ext_wildcard_paths() # The path to the temporary files STATIC_TEMP_PATH = FILE_DIR.joinpath('tmp') # In the webui root, on windows it exists by default, on linux it doesn't -TEMP_PATH = TAGS_PATH.joinpath('temp') # Extension specific temp files \ No newline at end of file +TEMP_PATH = TAGS_PATH.joinpath('temp') # Extension specific temp files + +# Make sure these folders exist +if not TEMP_PATH.exists(): + TEMP_PATH.mkdir() +if not STATIC_TEMP_PATH.exists(): + STATIC_TEMP_PATH.mkdir() \ No newline at end of file