mirror of
https://github.com/lllyasviel/Fooocus.git
synced 2026-08-16 13:13:16 +02:00
fix: correctly create directory for path_outputs if not existing (#1668)
* correctly create directory for outputs if not existing * feat: add make_directory parameter checks for list, extract make_directory to util
This commit is contained in:
@@ -188,3 +188,10 @@ def get_file_from_folder_list(name, folders):
|
||||
|
||||
def ordinal_suffix(number: int) -> str:
|
||||
return 'th' if 10 <= number % 100 <= 20 else {1: 'st', 2: 'nd', 3: 'rd'}.get(number % 10, 'th')
|
||||
|
||||
|
||||
def makedirs_with_log(path):
|
||||
try:
|
||||
os.makedirs(path, exist_ok=True)
|
||||
except OSError as error:
|
||||
print(f'Directory {path} could not be created, reason: {error}')
|
||||
|
||||
Reference in New Issue
Block a user