From 0fc5719d69c79d936435d8673acd35087a9b02cc Mon Sep 17 00:00:00 2001 From: aplaice Date: Sat, 26 Sep 2020 23:07:35 +0200 Subject: [PATCH] Fix creation of missing directories (#12) --- brain_brew/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/brain_brew/utils.py b/brain_brew/utils.py index 7c8ad2c..5ef1660 100644 --- a/brain_brew/utils.py +++ b/brain_brew/utils.py @@ -59,9 +59,9 @@ def find_all_files_in_directory(directory, recursive=False): def create_path_if_not_exists(path): dir_name = os.path.dirname(path) - if not Path().is_dir(): + if not Path(dir_name).is_dir(): logging.warning(f"Creating missing filepath '{dir_name}'") - os.makedirs(os.path.dirname(dir_name), exist_ok=True) + os.makedirs(dir_name, exist_ok=True) def split_tags(tags_value: str) -> list: